Add Unsubscribe Headers to Email for Mailing List Compliance

Add List-Unsubscribe and List-Unsubscribe-Post headers to emails sent using the dw.net.Mail class to support compliance with email provider guidelines, including Google Sender Guidelines. Use the new setListUnsubscribe and setListUnsubscribePost methods to integrate with externally-managed mailing lists and enable one-click unsubscribe functionality.

The dw.net.Mail class now includes two new methods:

  • setListUnsubscribe(String) - Sets the List-Unsubscribe header value to work with List-Unsubscribe-Post to allow integration with an externally-managed mailing list
  • setListUnsubscribePost(String) - Sets the List-Unsubscribe-Post header value to support one-click unsubscribe functionality

Both methods return the Mail object to support method chaining. These headers help comply with email provider requirements, including Google Sender Guidelines.

Where: This feature applies to B2C Commerce.

How: Use the new methods in your scripts when creating email with the dw.net.Mail class. For example:

mail.setListUnsubscribe("<https://example.com/unsubscribe>");
mail.setListUnsubscribePost("List-Unsubscribe=One-Click");

See Also