ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Manual mailing list unsubscribe

July 30, 2012 2:28pm

Subscribe [3]
  • #1 / Jul 30, 2012 2:28pm

    aircrash

    293 posts

    I’m using the MX Notify extension to send email to my mailing list. The extension uses a regular template as the email template, so it doesn’t have the standard unsubscribe link that is automatically added by the mailing list module. Is there a generic link that I can insert into my template to allow recipients to unsubscribe?

  • #2 / Jul 31, 2012 12:14pm

    Shane Eckert

    7174 posts

    Hello aircrash,

    Thank you for posting your question here on the ExpressionEngine forums.

    The {unsubscribe_url} tag will not work outside of the Email templates.

    Does the MX documentation have anything on this? Seems odd to limit something so useful.

    Sorry I do not have a better answer.

    Cheers,

  • #3 / Oct 11, 2012 10:51am

    compass360

    13 posts

    aircrash, if you’re comfortable working with the Query module, there may be a fairly straight-forward solution (I haven’t verified this).

    The unsubscription links are unique to each individual email address via an “Authcode”. The URL for unsubscription links in the current build of EE is:

    <a href="http://www.domain.com/index.php?ACT=5&id=AUTHCODE">http://www.domain.com/index.php?ACT=5&id=AUTHCODE</a>

    The Authcodes are stored in the “exp_mailing_list” table in the DB in the same row as the user’s email address.

    So if the Notify extension processes the “normal” template prior to sending it out, you should be able to use the Query module to do a cross-reference with the “exp_mailing_list” database, matching the email to the Authcode in order to build your link. Something like this (perhaps in an embedded template if necessary):

    {exp:query sql="SELECT authcode FROM exp_mailing_list WHERE email = '{email}'"}
    <a href="http://www.domain.com/index.php?ACT=5&id={authcode}">http://www.domain.com/index.php?ACT=5&id;={authcode}</a>
    {/exp:query}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases