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.

2
  • 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! Commented May 16, 2017 at 17:18
  • I have updated the formatting
    – 0xsegfault
    Commented May 16, 2017 at 17:22

1 Answer 1

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>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .