Search code examples
phpapimailjet

How to manage unsubscribe link in a newsletter with mailjet PHP API?


I manage a mailing campaign with mailjet API.

I can create a campaign and send it with $mj->post to a contact list.

I've tried to add an existing template (which has unsubscribe link) to the newsletter but it's impossible.

So I don't know how to manage unsubscribe link inside the newsletter.


Solution

  • According to your message, I understand you want to have the unsubscription link inserted in the body of your newsletter.

    If this is the case, then you have to mention [[UNSUB_LINK]] in the newsletter body (see here for full instructions).

    When sending/testing, Mailjet system will replace the tag with the correct value, in the locale specified in the newsletter resource.

    Hope it helps.

    Arnaud from Mailjet.