Creating page-based newsletters

jeff McDaniel asked on March 13, 2017 17:25

Hi,

We have a page-based newsletter created on Kentico 10.0.7. I've been following the below page for guidance but I'm running into a problem. https://docs.kentico.com/k10/on-line-marketing-features/managing-your-on-line-marketing-features/email-marketing/creating-newsletters

I have all the steps down and pages created except for one. The page I've created has the {%UnsubscribeLink%} Macro for users to unsubscribe to our newsletter. However, due to the source being a page instead of a standard email template, the unsubscribe macro does not resolve and the I get an error saying "unsubscribe does not resolve in this context."

I've attempted to write my own macro for this but have gotten stuck. I found a macro from previous versions and I've made it look something like the below. This fails every time, and I think it is due to insufficient information. It looks like the {UnsubscribeLink} resolving in the template based newsletters has a hash field, as well as the subscriber email. How do I get this information, or is there something else I can try?

http://{% CurrentSite.SiteDomainName #%}/Newsletter-Unsubscription-Request?email={%???Need to get contact email%}&newsletterguid={%NewsletterGUID%}&issueguid={%IssueID%}&hash={%How can I get the Hash%}

Correct Answer

Brenden Kehren answered on March 13, 2017 18:05

When using dynamic newsletters, the {%UnsubscribeLink%} macro will be properly rendered in the email that is sent. It will not be rendered on the page because when the page is displaying it, it has no idea you will be using it for a newsletter email; to Kentico, it's just another page or set of pages in the content tree. So if you've created your dynamic newsletter and actually sent a valid (not test email) to a subscriber, then it will resolve the unsubscribe link for you. Keep in mind you cannot send a test email as the unsubscribe link will not be rendered.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Zach Perry answered on March 13, 2017 17:34

Did you add {%UnsubscriptionLink%} to the page? The actual macro you should add to the page should be {%UnsubscribeLink|(resolver)subscriber%}

1 votesVote for this answer Mark as a Correct answer

jeff McDaniel answered on March 13, 2017 17:46 (last edited on March 13, 2017 17:47)

Hi Zachary,

Thanks for your response. I apologize, I was using the {%UnsubscribeLink%} not the {%unsubscriptionLink%}. I updated my post accordingly.

As for your suggestion, I tried the macro you suggested and it did not resolve.

I used the below syntax

<a style="color:#008265;" href="{%UnsubscribeLink|(resolver)subscriber%}">Unsubscribe </a>

This returned [{%UnsubscribeLink|(resolver)subscriber%}]Unsubscribe

once the email sent. It did not resolve as a link.

for a further test if I do <%UnsubscribeLink|(resolver)subscriber %>, I get the UnsubscribeLink does not resolve in this context error

0 votesVote for this answer Mark as a Correct answer

jeff McDaniel answered on March 13, 2017 18:22

Hi Brenden,

That was the problem, thanks! I was trying to send out test emails. Once I sent out a real email with that macro set, I was able to get it resolved.

Jeff

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on March 13, 2017 18:50 (last edited on March 13, 2017 18:52)

Hi Jeff

All you need to do is in your page, add this macro {%UnsubscribeLink|(resolver)subscriber%} which will generate the correct link in format like this http://localhost/unsubscribe?issueguid=8b29f7d3-436a-4420-b5c1-70e98eac6e68&email=ruiw%40kentico.com&hash=5bd41b650d9824b514f2d7afbb0198434f9d48a0d9fdbbe68308915b5f62c3c7&newsletterguid=de722f0e-05d4-4e81-a7d9-b3878e17d89e

This macro generate the whole <a href...>Unsubscribe HTML, so you cannot use it inside your own <a href

The key to resolve email macro in page is to add the (resolver)subscriber part.

Here is the related article: http://devnet.kentico.com/articles/resolving-macros-in-dynamic-newsletter

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.