Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Add ListManagementOptions in SES mail transport #50660

Merged
merged 3 commits into from Mar 21, 2024

Conversation

arifszn
Copy link
Contributor

@arifszn arifszn commented Mar 19, 2024

Description

Amazon SES provides a convenient feature allowing the inclusion and management of unsubscribe links and headers in outgoing emails by specifying a contact list name and an optional topic name. When the ListManagementOptions header is passed, it substitutes the {{amazonSESUnsubscribeUrl}} placeholder with a one-click unsubscribe link in the email body.

References:

Similar to symfony/symfony#53901, this PR proposes adding ListManagementOptions in the headers of SesTransport and SesV2Transport.

Usage

  • Follow the AWS instructions to create a contact list

  • Optional: add a topic to the list

  • Add X-SES-LIST-MANAGEMENT-OPTIONS in the header

      /**
       * Get the message headers.
       */
      public function headers(): Headers
      {
          return new Headers(
              text: [
                  'X-SES-LIST-MANAGEMENT-OPTIONS' => 'contactListName=MyContactList;topicName=MyTopic',
              ],
          );
      }

Upon merging this PR, a PR for updating doc will be submitted if necessary.

Note

While it's possible to utilize the options array within the ses configuration to include the ListManagementOptions header, it wouldn't offer the same level of dynamism.

@taylorotwell taylorotwell merged commit 075bda5 into laravel:11.x Mar 21, 2024
28 checks passed
@arifszn arifszn deleted the ses-ListManagementOptions branch March 23, 2024 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants