Today a message of salesforce popped up:
Unfortunately it popped up after we had a journey activity that had send emails. We changed nothing at our sender profiles (that work with ampscript) or the scripts[code snippet content blocks].
How we set sender profiles:
- ContentBlockByKey inside the sender profile for fromname and fromemail (with 2 different ampscripts)
%%=v(@var)=%%
at the end of the Ampscript to print the value that is set by the ampscript logic.
This has never been a problem but today our newsletter looked like this in the sender section:
<!----> Business Name<!----> <!---->
For test sends and journey builder email send activities we get the behaviour i described above, for normal sends it works like before.
- The particular sender profile is marked as verified.
Ampscript looks like (shortened) and dots (...) added. [It is working and was working correct for the last 6 month since it was coded, you can still tell me what to improve though ;)]:
%%[
var @fromName
var @profileName
set @defaultName = "XXX"
set @country = [country]
set @language = [language]
set @country = UpperCase(@country)
set @language = UpperCase(@language)
/* Germany */
IF @country == "DEU" THEN
IF @language == "DE" THEN
set @profileName = Concat(@country,"_",@language,"_PROFILE")
ELSE
set @profileName = "DEU_DE"
ENDIF
ELSEIF ... THEN
/* some comment */
ELSEIF ... THEN
/* some comment */
...
ELSE
set @profileName = "DEFAULT"
ENDIF
set @fromName = LookUp("PROFILE_DEX","FromName","SendProfileName",@profileName)
set @fromName = IIF(EMPTY(@fromName),@defaultName,@fromName)
]%%
%%=v(@fromName)=%%
What can I do that this weird html comments do not show?
// comment
but they are all inside the AmpscriptBlock.%%[ set @fname = "fname" // set @fname = "Germany " ]%%
(with correct formatting) outputting%%=v(@fname)=%%
it would output:Germany
notfname
. Which means it is not acting as a comment.