Skip to content

SparkPost.transmissions.send is ignoring CC: and BCC: if recipient list ID is provided #226

Open
@dgoldenberg-audiomack

Description

@dgoldenberg-audiomack

My test code sends out email messages as intended to the given recipient list but appears to completely ignore the CC: and BCC: addresses. (Unless there's something wrong in the below invocation?)

SDK version: 1.3.10

Code:

from sparkpost import SparkPost
sp = SparkPost("1234..........6789")
response = sp.transmissions.send(
    use_sandbox=False,
    recipient_list="acme-test-recipient-list",
    html="<html><body><p>This is a test email notif; please ignore.</p></body></html>",
    from_email="reports@acme.com",
    subject="Test email message; please ignore",
    bcc=["my_own_personal_email@gmail.com", "my_own_personal_email@yahoo.com"],
    reply_to="data@acme.com",
)
print(response)

From debugging, I can tell the field is making it into the payload but doesn't appear to be used (email doesn't get sent to the CC: or BCC: addresses)

{
	"bcc": ["my_own_personal_email@gmail.com", "my_own_personal_email@yahoo.com"],
	"content": {
		"from": {
			"email": "reports@acme.com"
		},
		"reply_to": "data@acme.com",
		"subject": "Test email message; please ignore",
		"html": "<html><body><p>This is a test email notif; please ignore.</p></body></html>"
	},
	"options": {
		"sandbox": false
	},
	"recipients": {
		"list_id": "acme-test-recipient-list"
	}
}

Responses look like this:

{
	'total_rejected_recipients': 0,
	'total_accepted_recipients': 2,
	'id': '7204854351104320440'
}

(Of note: I have tried supplying CC or BCC as a string vs. list, and a single value vs. multiple values, to no avail so far)

Any idea as to why this is happening? A workaround? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions