Question

Photo of Jon Horton

0

How do you pass a Person.URLEncodedKey to a Global Attribute?

We currently use email templates that take advantage of Global Attributes. For instance, we have a {{ Global.EmailHeader }} + {{ Global.EmailFooter }} vars that allow our users to quickly and easily created branded emails.

The issue is that our Global.EmailFooter attribute contains the unsubscribe url:

<a href="{{ 'Global' | Attribute:'PublicApplicationRoot' }}Unsubscribe/{{ Person.UrlEncodedKey }}" class="colfax" style="margin: 0px;">Unsubscribe From This List</a>

When the email is sent, the url isn't parsing the Person.UrlEncodedKey, so the parsed URL looks like /Unsubscribe/ instead of containing a key.

What's the proper way to have the {{ Person.UrlEncodedKey }} parse when used in a Global attribute?

Thanks!


  • Photo of Michael Garrison

    0

     Is ~/Unsubscribe a custom page you've created? Typically you can just use the default [[ UnsubscribeOption ]] tag, which will handle all the linking and only show up on bulk mailings, etc. But if you have a custom page, perhaps you're using the UrlEncodedKey to "log in" the person receiving the e-mail so you can add them to a group or something like that?

    In that case you may want something like this:

    <a href="{{ 'Global' | Attribute:'PublicApplicationRoot' }}Unsubscribe?Person={{ Person.UrlEncodedKey }}" class="colfax" style="margin: 0px;">Unsubscribe from this List</a>

     

    • Jon Horton

      Hey Michael! We do use the /Unsubscribe page, but that page without the UrlEncodedKey requires a user to signin. In the case of emails, it's possible for a user to not have an account, making it impossible for them to adjust their settings, which is the reason for wanting to use the encoded key.


      I've tried the UnsubscribeOption tag, but it doesn't appear to the use the key, thus requiring a sign in. :(