Reputation: 1
Starting from February 2024, Google requires that messages exceeding 5,000 per day must support one-click unsubscribe. Google Reference
I am using mailgun-js with node js and express to send batch emails to the users. (the users are in my database) and manually added the necessary headers for one-click unsubscribe as follows: example:
'h:List-Unsubscribe': '<https://solarmora.com/unsubscribe/example>, <mailto:[email protected]>',
'h:List-Unsubscribe-Post': 'List-Unsubscribe=One-Click',
When inspecting the message source in Gmail, these headers are present, and DMARC also specifies them. However, the Gmail UI does not display any unsubscribe links or related options.
Here's a snippet of the Node.js code I'm using for sending emails:
sendEmail: function (emailAttribute, emailFrom, cb) {
var api_key = config.mailConfig.mailgunApiKey;
var domain = config.mailConfig.mailgunDomain;
var mailEmail = emailFrom;
var mailgun = require('mailgun-js')({apiKey: api_key, domain: domain});
var templateHtml = emailAttribute.body_content;
';
var data = {
from: `<${mailEmail}>`,
to: emailAttribute.to,
subject: emailAttribute.subject,
body: emailAttribute.body_content,
'recipient-variables': emailAttribute.receipentsVar,
html: templateHtml,
'h:List-Unsubscribe': '<https://my-website/%recipient._id%/unsubscribe-test>, <mailto:[email protected]>',
'h:List-Unsubscribe-Post': 'List-Unsubscribe=One-Click',
};
mailgun.messages().send(data, cb);
}
I suspect the issue might be related to how Gmail processes these headers or if there's something missing in my code or Mailgun setup. Any insights or suggestions on how to resolve this would be highly appreciated. Thanks in advance! PS: DMARC, SPF, and DKIM have been properly configured and successfully passed validation in our email setup
Upvotes: 0
Views: 323