Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
WIP: Add REST email send.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmac committed Jul 30, 2014
1 parent e0fa8a8 commit 2aa24dd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions news/backends/et_rest.py
Expand Up @@ -24,6 +24,7 @@ class ExactTargetREST(object):
api_urls = {
'auth': 'https://auth.exacttargetapis.com/v1/requestToken',
'sms_send': 'https://www.exacttargetapis.com/sms/v1/messageContact/{msg_id}/send',
'email_send': 'https://www.exacttargetapis.com/messaging/v1/messageDefinitionSends/{send_id}/send',
'validate': 'https://www.exacttargetapis.com/address/v1/validateEmail',
}

Expand Down Expand Up @@ -106,6 +107,19 @@ def send_sms(self, phone_numbers, message_id):
}
return self.request('sms_send', data, url_params={'msg_id': message_id})

def send_email(self, email, message_id):
data = {
'From': {
'Address': 'pmac@mozilla.com',
'Name': 'Email Overlord',
},
'To': {
'Address': email,
'SubscriberKey': email,
}
}
return self.request('email_send', data, url_params={'send_id': message_id})

def validate_email(self, email):
data = {
'email': email,
Expand Down

0 comments on commit 2aa24dd

Please sign in to comment.