mailjet / MailjetSwiftMailer

A SwiftMailer transport implementation for Mailjet
MIT License
26 stars 23 forks source link

CustomCampaign #13

Open olivier-sabban opened 6 years ago

olivier-sabban commented 6 years ago

Hi,

I would like to use mailjet "CustomCampaign" property to attach my mail to a campain. https://dev.mailjet.com/guides/#grouping-into-a-campaign

I did not find any logic property of Swift_Mime_Message to link correctly CustomCampain into your getMailjetMessage function to push a pull request

Do you have any simple idea or do I need to build my own Swift_Transport ?

Nightbr commented 6 years ago

ping @Zhivko-Mailjet

latanasov commented 6 years ago

cc @eboisgon

Nils-1st-retail commented 5 years ago

I have been working on the same problem and sound a solution. In https://app.mailjet.com/docs/emails_headers it is stated that you can send the custom campaign name as a header named 'X-Mailjet-Campaign' this seems to work for me.

$headers = $swiftMsg->getHeaders();
$headers->addTextHeader('X-Mailjet-Campaign', "CustomCampaignName");