-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error using cc or bcc with recipients substitution_data #118
Comments
medmunds
referenced
this issue
in anymail/django-anymail
Jun 23, 2016
python-sparkpost generates a transmissions.send payload which is now considered invalid by the API, if you try to use both `cc` (or `bcc`) and the `recipients` dict structure required for merge_data. [Anymail had been generating that recipients dict structure in all cases, for simplicity. Sometime between 2016-06-07 and 2016-06-22, SparkPost began rejecting that if it appeared in the `header_to` constructed by python-sparkpost.]
Tested this and it's still an issue. Sample response:
Looking at that error a json object is being passed to header_to, instead of what is required, a string. |
Some further investigation - the issue appears to be in the {
"description": null,
"recipients": [
{
"substitution_data": {
"order_no": "12345"
},
"address": {
"email": "[email protected]"
}
},
{
"address": {
"header_to": {
"substitution_data": {
"order_no": "12345"
},
"address": {
"email": "[email protected]"
}
},
"email": "[email protected]"
}
}
],
"campaign_id": null,
"return_path": "[email protected]",
"content": {
"from": {
"email": "[email protected]"
},
"attachments": [],
"text": "test merge {{ order_no }}",
"headers": {
"CC": "[email protected]"
},
"html": null,
"reply_to": null,
"use_draft_template": false,
"template_id": null,
"subject": "test"
},
"substitution_data": null,
"options": {
"skip_suppression": null,
"open_tracking": null,
"start_time": null,
"inline_css": null,
"transactional": null,
"sandbox": null,
"click_tracking": null,
"ip_pool": null
},
"metadata": null
} |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At some point in the past couple of weeks, SparkPost started rejecting the cc recipient in the following call:
The problem seems to be in the payload's
header_to
generated for thecc
. If you omit thecc
parameter, it works fine. Similarly, if you change to a simplerecipients=['[email protected]']
, the send is accepted (albeit without the intended substitution data).This worked (or at least was accepted by the API) on 2016-06-07. I don't believe python-sparkpost has changed during that period. Is this a problem in python-sparkpost, or an intentional API clarification/change? If the latter, is there way to specify substitution_data and cc (or bcc) in the same transmission?
python 3.5 (or 2.7); python-sparkpost 1.2.0
The text was updated successfully, but these errors were encountered: