Skip to content

How can we override default the Sparkpost From email set in template when we send email from sparkpost python? #230

Open
@JayDarjiAubergine

Description

@JayDarjiAubergine
sp = SparkPost(settings.SPARKPOST_API_KEY)
try:
    sp.transmission.send(
        recipients=to,
        bcc=bcc,
        from_email=from_email,    # I tried this, but still it's not working
        template=template_id,
        substitution_data=substitution_data,
        transactional=True,
        ip_pool=settings.SPARKPOST_IP_POOL,
        content={"from": from_email}    # Tried to override the from email like this, but this is not working
    )
except SparkPostAPIException as e:
    capture_exception(e)

This is how we send email, but I want to override the from email in place of default set in template settings.
Why? because we have different from email for different environments.

So How can I achieve that?


Maybe related to this: #161

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