My Mautic version is: 4.4.11
My PHP version is: 7.4.33
Hey, for anyone using Gmail as their SMTP, here’s a nice trick I put together to have Mautic recognize the emails and process them:
- Create a Label called “Mautic” in my Inbox
- Put this little script in a Gmail App Script:
function myFunction() {
let threads = GmailApp.getInboxThreads();
var label = GmailApp.getUserLabelByName("Mautic");
threads.forEach(function(thread, index, threads) {
let message = thread.getMessages()[0];
let header = message.getHeader('List-Unsubscribe');
if (header.includes("https://mautic.leewayweb.com/email/unsubscribe/")) {
thread.addLabel(label);
Logger.log("Thread from mautic: " + thread.getFirstMessageSubject());
}
});
}
- Setup my Mautic to fetch emails from the Mautic folder in my inbox.
Now my Mautic is tracking bounces