How to send a SparkPost email via API with a CC and BCC
Originally I found this which only vaguely pointed me in the right direction, so I thought I'd create a gist of what ended up working for me.
To add a CC address, you have to two two things
- Add the address to your recipeints array, and set the
header_tovalue to an address in the
tofield. So if you're sending the email to
email@example.com CCing it to
firstname.lastname@example.org need to be set to
- Add the email to the
contentobject. If you have multiple emails, these should be comma separated.