0

I have the following Ampscript block:

%%[var @CountryCode, @Text,@Header SET @CountryCode = PersonMailingCountryCode ]%%
%%[IF @CountryCode == "FR" THEN SET @Header = "Happy Birthday"
ELSE SET @Header = "No" ENDIF]%%`
<h1 style="text-align: center; font-family : arial,helvetica,sans-serif;
font-size : 28px; color : #808080; line-height : 1; font-weight : bold;
font-style : normal; ">%%=v(@Header)%%</h1>

When I try to preview it, I get the following error:

The subscriber preview failed to generate. Review the details, correct all issues, and try again. Personalization error: %%&etrnm=%% To fix the problem, please try the following: - Make sure that there is not a space or typo within the personalization string in your email. For example, check and correct any spaces between percent signs (%%) - Correct the HTML Body of your email. Personalization error: %%"> <font face="verdana" size="1" color="#777777"><br> <a href="%% To fix the problem, please try the following: - Make sure that there is not a space or typo within the personalization string in your email. For example, check and correct any spaces between percent signs (%%) - Correct the HTML Body of your email. Personalization error: %%" alias="manage subscriptions">manage subscriptions</a> | <a href="%% To fix the problem, please try the following: - Make sure that there is not a space or typo within the personalization string in your email. For example, check and correct any spaces between percent signs (%%) - Correct the HTML Body of your email. Personalization error: %%" alias="update profile">update profile</a> | <a href="%% To fix the problem, please try the following: - Make sure that there is not a space or typo within the personalization string in your email. For example, check and correct any spaces between percent signs (%%) - Correct the HTML Body of your email.

I have tried moving the syntax around but to no avail. I will appreciate guidance on this.

  • Please check the formatting of your post and try to improve it, so the complete AMPscript code relevant to resolve the error is provided, as well as the error message is formatted properly, so finding the error is easier. Thank you! – Markus Slabina May 16 '17 at 17:18
  • I have updated the formatting – Samuel Dare May 16 '17 at 17:22
2

I believe the issue is just a small mistype. You need to close your variable call for header with '=%%'. See below:

%%[var @CountryCode, @Text,@Header SET @CountryCode = PersonMailingCountryCode ]%%
%%[IF @CountryCode == "FR" THEN SET @Header = "Happy Birthday"
ELSE SET @Header = "No" ENDIF]%%`
<h1 style="text-align: center; font-family : arial,helvetica,sans-serif;
font-size : 28px; color : #808080; line-height : 1; font-weight : bold;
font-style : normal; ">%%=v(@Header)=%%</h1>
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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