0

I am trying to use the custom sender name in the email that is being displayed. I just want to change the display name of the sender's name. For instance, if I have: abc@def.com The name displayed is: abc.

I want a custom name like: Sender_abc

This is how I am updating the message:

message = Mail(
        from_email=Email(from_email, from_name),
        subject=subject
    )

This code works fine for Domain Authentication and shows the custom name but doesn't work when I try to use it with Single Sender Verification.

Here is the later part of the code for getting the response:

response = sg.client.mail.send.post(request_body=message.get())
  • I don't know of a reason that the from name wouldn't come through when sending from a Single Sender. Your code looks correct, is there any more context to that code, something that might unset or miss setting `from_name` unintentionally? – philnash Mar 29 '22 at 00:49
  • I don't see anything un-setting from_name. Here is the message which contains both from_email and from_name: – Garima Arora Mar 29 '22 at 06:41
  • {'_headers': [], '_custom_args': [], '_send_at': None, '_mail_settings': None, '_reply_to': None, '_categories': [], '_from_email': {'_email': 'garima.arora@workspan.com', '_name': 'Test'}, '_template_id': u'd-a139bcead590483f8032c516d0f094d4', '_contents': [{'_value': u'# intended receiver: clark@work.com #', '_validator': , '_type': 'text/plain'}, {'_value': u'# intended receiver: clark@work.com #', '_validator': , '_type': 'text/html'}], '_ip_pool_name': None,} – Garima Arora Mar 29 '22 at 06:43
  • Here "Test" is what I want to display for the given email. – Garima Arora Mar 29 '22 at 06:43
  • Yep, that looks correct. This might be a better question for [SendGrid support](https://support.sendgrid.com/hc/en-us) since you say the code works for domain authentication, but not for your verified sender. – philnash Mar 29 '22 at 06:46

0 Answers0