I've been trying to add unsubscribe and optout functionality to the default "Welcome Message" email template you find under Administer, Header, Footers, and Automated Messages. I don't have HTML experience but using the code in the "Mailing Footer" sample, the documentation, and a wysiwyg editor, I added this in the Body - HTML Format text block of the "Welcome Message":

<p><span style="font-size:14px;"><span style="font- family:arial,helvetica,sans-serif;">To unsubscribe from this newsletter, <a href="{action.unsubscribeUrl}">click here</a>.  <br /> To opt out of all future emails from us, <a href="{action.optOutUrl}">click here</a>.</span></span></p>

When I test this and produce the Welcome email, these tokens don't appear as links, only text. I've been researching this all day with no luck. Please help!

I'm on Wordpress 4.7.5 and CiviCRM 4.7.16.

2 Answers 2


I expect the token only gets populated with the relevent URL when it is used as part of a CiviMailing.

The automated message you are referring to does not go out via CiviMail, so it is possible that it will not function in that feature.

Since it seems that the checksum doesn't work directly with civicrm/mailing/subscribe?reset=1 you can set up a Profile that includes your public mailing lists, and send them to that. Bit of a pain having to do the extra steps.

Using tokens for Profiles is detailed here: https://wiki.civicrm.org/confluence/display/CRMDOC/Tokens

And using Profiles for Mailing Lists is here: https://docs.civicrm.org/user/en/4.7/email/set-up/#allow-people-to-sign-up-for-your-mailing-lists-online

  • If that's the case, how do you comply with the requirement that every email an org send needs to include this opt-out link? This is not some custom message we're trying to shoehorn into the system - it's the built-in email generated when a website visitor signs up for a mailing list. What do other organizations do?
    – Ruth D
    May 21, 2017 at 17:01
  • Not sure which requirements you are referring to but my understanding has been that this generally refers to bulk mailing lists. If someone signs up to such a list - then they may get a welcome - but the Opt Out is required on the bulk mailing.
    – petednz - fuzion
    May 21, 2017 at 19:51
  • 1
    I have added a para to my answer explaining how your 'welcome' email could link to civicrm/mailing/subscribe
    – petednz - fuzion
    May 21, 2017 at 19:54
  • Thanks petednz, can you elaborate on how to "providing a link with a checksum to civicrm/mailing/subscribe"?
    – Ruth D
    May 21, 2017 at 20:46
  • Added in Answer
    – petednz - fuzion
    May 23, 2017 at 22:55

I believe the final answer is that you cannot insert an action token into an automated message. Looking further into the CAN-Spam Act, which says you don't need to include unsubscribe links in transactional email, I guess strictly speaking we don't need to include this unsubscribe link in the "Welcome" email. Would still be a welcome feature.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.