This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: include a message variation id with campaign_id for enterprise e…
…mails. Braze requires that a message variant be present when campaign_id is specified in a message sending request. ENT-5285
- Loading branch information
1 parent
c0eef8e
commit 20d706b
Showing
4 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -296,6 +296,7 @@ def send_message( # pylint: disable=dangerous-default-value | |
reply_to='', | ||
attachments=[], | ||
campaign_id='', | ||
message_variation_id=None, | ||
): | ||
""" | ||
Sends the message via Braze Rest API /messages/send | ||
|
@@ -308,6 +309,7 @@ def send_message( # pylint: disable=dangerous-default-value | |
reply_to (str): Enterprise Customer reply to address for email reply | ||
attachments (list): list of dicts with filename and url keys | ||
campaign_id (str): The id of the campaign this email is associated with | ||
message_variation_id (str): The id of the message variant associated with the given campaign_id | ||
Request message format: | ||
Content-Type: application/json | ||
|
@@ -323,6 +325,7 @@ def send_message( # pylint: disable=dangerous-default-value | |
"from": "edX <[email protected]>", | ||
"reply_to": "[email protected]", | ||
"body": "<html>Test</html>", | ||
"message_variation_id": "email-1234", | ||
"attachments": [ | ||
{ "file_name": "filename1", "url": "url1" }, | ||
{ "file_name": "filename2", "url": "url2" } | ||
|
@@ -366,6 +369,8 @@ def send_message( # pylint: disable=dangerous-default-value | |
email['attachments'] = attachments | ||
if reply_to: | ||
email['reply_to'] = reply_to | ||
if message_variation_id: | ||
email['message_variation_id'] = message_variation_id | ||
message = { | ||
'user_aliases': user_aliases, | ||
'external_user_ids': external_ids, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters