Hello
I am using ElasticEmail to send emails from ThirtyBees. I specify that the emails sent by ThirtyBees are transactional emails. This way, people who have unsubscribed my emails (marketing/newsletter emails) still receive transactional emails (order confirmation, etc.). This is done by adding a header to the emails, IsTransactional: True.
More info: https://help.elasticemail.com/en/articles/2419281-what-is-the-difference-between-marketing-and-transactional-email
I pass this header when sending emails from ThirtyBees.
Up to TB 1.4
I took Mail.php class, added this line and placed the edited Mail.php class in /override/classes/Mail.php
/* Send mail */
$message->setFrom([$from => $fromName]);
$message->getHeaders()->addTextHeader("IsTransactional", "True");
$shouldSend = $configuration['PS_MAIL_METHOD'] != static::MAIL_METHOD_NONE;
$send = $shouldSend ? $swift->send($message) : true;
With TB 1.5
Things are changing. Mail.php class now uses MailTransport and an associated module. Here is how I have achieved passing IsTransactional: True header.
1/ In TB admin, install and activate the module: Mail via swiftmailer
2/ Configure the module to use PHP's mail() function
3/ Edit /modules/tbswiftmailer/src/SwiftMailerTransport.php by adding the last line here:
$message = Swift_Message::newInstance();
$message->setSubject($subject);
$message->setCharset('utf-8');
$message->setId(static::generateId());
$message->setFrom($fromAddress->getAddress(), $fromAddress->getName());
$message->setReplyTo($replyTo->getAddress(), $replyTo->getName());
$message->getHeaders()->addTextHeader("IsTransactional", "True");
And now all emails sent by ThirtyBees will have the IsTransactional: True header.