emailsendgridsendgrid-api-v3

How to add a FROM_NAME to emails we send?


I have an application that is sending email through SendGrid API v3. We would like to add a from name to make the emails easier to identify in the users inbox. For example, having a from_name like My Application to go with the from_email support@application.com.

Our current Mail object:

Mail(
        from_email = EMAIL_CREDENTIAL['FROM_EMAIL'],
        to_emails = to_email,
        subject = subject,
        html_content = html_content,
        is_multiple=is_multiple
    )

When I try to add a name or from_name variable I get an error. I have not found any entries in SendGrid's API support. Is there a value to add so I can add a name?

For clarification, I am sending from a Django app (Python) using the SendGridAPIClient.


Solution

  • Not sure if you have already tried the below but this might be worth a try?

    from_email=Email("My Application <support@application.com>"),