When I use the below code, the email sends to all recipients, however, the email headers aren't set correctly as the CC recipient isn't appearing in the email, all recipients only see the main recipient appearing in the email.
Does anyone know why the CC recipient wouldn't show? The BCC isn't showing as expected but I am unsure if this is because the headers are incorrect.
from sparkpost import SparkPost
from sparkpost.exceptions import SparkPostAPIException
sparky = SparkPost()
sparky.transmissions.send(
from_email={
'email': sender,
'name': "SenderName"
},
recipients=['[email protected]'],
cc=['[email protected]'],
bcc=['[email protected]'],
template=template_id,
subject=subject_line,
ip_pool='mailer',
track_opens=True,
track_clicks=True,
use_draft_template=True,
substitution_data={
'SUBJECT': "test",
'ADDRESSEE': "test addressee",
'CONTENT_STRING':"content",
'SENDER': "[email protected]",
'REPLY_TO': "[email protected]",
'FROM_NAME': "Sender"
}
)
Just ran into this myself. You have to include your cc email(s) in both recipients and cc.
In your example, your recipients/cc would be updated to:
From their documentation: (https://www.sparkpost.com/docs/faq/cc-bcc-with-rest-api/)