0

Today a message of salesforce popped up:

enter image description here

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?

  • Our dynamic sender profile works fine, just did a test via Journey Builder. Although in our configuration we use ContentBlockByName. Anyway, in your content block, are you printing the values out properly? Like %%=v(@fromName)=%% and using the same in sender profile? – Rain Feb 11 at 13:35
  • Thank you for testing. Yes, thats exactly what we do. Some big ampscript blog starting with %%[ and ending with ]%% after that it just follows %%=v(@var)=%%, like stated in the post. – Johannes Schapdick Feb 11 at 13:53
  • Try copying script and the print-out variables to an Email template and do a subscriber preview. If you see the variables being populated correctly. In case it works, as experiment you can try creating a new Sender Profile with same configuration and test using that. – Rain Feb 11 at 14:05
  • 1
    The content block is a code snippet not an html content block. I do have many comments in it (33) that look like inline comments // comment but they are all inside the AmpscriptBlock. – Johannes Schapdick Feb 11 at 14:18
  • 2
    if you use %%[ set @fname = "fname" // set @fname = "Germany " ]%% (with correct formatting) outputting %%=v(@fname)=%% it would output: Germany not fname. Which means it is not acting as a comment. – Gortonington Feb 11 at 22:17
0

Salesforce has admitted that they have screwed up their implementation.

Hi Johannes,

My name is XXX, and I'm the Tier 2 Developer Support agent who's taken ownership of this case. Our team is aware of this issue and is currently working to resolve it. As a short-term workaround, can you please try copying your AMPScript from your content blocks and placing it directly in the from name and from email of your sender profile? ...

Thank you,

XXX XXX

Success Agent - Tier 2

Salesforce Technical Support

So for all that use the configuration like I have described in my question, it will create this error.


Solution is not like stated in the comment from support:

  1. %%[ContentBlockByKey("sender-profile")]%%%%=v(@fromEmail)=%%
    1. Deleting the %%=v(@fromEmail)=%% from the ampscript itself

Posting your complete ampscript into the fromname and fromemail of the sender profile will cause errors when you try to save it into the sender profile. Atleast for me.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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