Problem/Motivation

I'm having an issue with defining the sender's name when sending emails through this module. Currently, when I send an email, the sender's name automatically uses the part of the email address before the @ symbol. For example, if the email address is support@example.com, the sender's name appears as "Support".

My question is, is there a way to define or customize how the sender's name shows, instead of it automatically using the part before the @ symbol?

Issue fork amazon_ses-3454004

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chucksimply created an issue. See original summary.

davisben’s picture

Version: 3.0.1 » 3.0.x-dev
Assigned: Unassigned » davisben
Category: Support request » Feature request

That isn't currently an option, but it should be fairly easy to add.

davisben’s picture

Assigned: davisben » Unassigned
Status: Active » Needs review

I think this should do it. Give it a try and see if it meets your needs.

chucksimply’s picture

Status: Needs review » Reviewed & tested by the community

Hey @davisben... I appreciate you working on this. Patched with the merge and working perfectly! Thanks again!

davisben’s picture

Thanks for confirming! I'll fix the tests and get it committed.

chucksimply’s picture

Status: Reviewed & tested by the community » Needs work

The patch doesn't play nice with Webform. If you set the "Sender From Name" in a webform email, the following errors occur.

Drupal\Core\Entity\EntityStorageException: Email ""WEBFORMSENDERNAME" <support@sitename.com>" does not comply with addr-spec of RFC 2822. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of /web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

and

Symfony\Component\Mime\Exception\RfcComplianceException: Email ""WEBFORMSENDERNAME" <support@sitename.com>" does not comply with addr-spec of RFC 2822. in Symfony\Component\Mime\Address->__construct() (line 54 of /vendor/symfony/mime/Address.php).

I'm seeing a double quote "" before the sender name, not sure if this is relevant.

chucksimply’s picture

StatusFileSize
new59.44 KB

Screenshot attached showing where the sender name is set in the webform email config.

davisben’s picture

Status: Needs work » Needs review

I made some changes so it plays nice with Webform, or any other module that sets a from address. Could you give it another test?

chucksimply’s picture

Yes, looks to be working as expected. Thanks!

davisben’s picture

Status: Needs review » Fixed

Merged.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.