0

Let's say I would like to setup the FromEmailAddress of the sender profile with both dynamic value and static text. The FromEmailAddress would contain two parts : the account name which is dynamic and a static text '@email-3Dagency.com'. Here is an example of the output I would like for the Account named 'Digital Print' : DigitalPrint@email-3Dagency.com

The value of the field 'Account name' is filled by Salesforce Data when the journey runs. Indeed, account name is a data entry for the journey and the value comes from Salescloud. The account name is always filled in SF.

I had tried to create this Ampscript code in the from email field in the sender profile but the email is not sent when I run the journey: %%[ set @fromemail = CONCAT(@accountname, "@email-3Dagency.com") set @accountname = AttributeValue("Account:Name") endif ]%% %%=v(@fromemail)=%%

Do you know how I can resolve the issue and if the code above is accurate ?

  • You'll get a lot more eyes on your SFMC questions over at [salesforce.stackexchange.com](http://salesforce.stackexchange.com), specifically with the [marketing-cloud](http://salesforce.stackexchange.com/questions/tagged/marketing-cloud) and [ampscript](http://salesforce.stackexchange.com/questions/tagged/ampscript) tags. – Adam Spriggs May 09 '22 at 14:58
  • You're using `@accountname` in your concat before you're defining it. That seems like the first thing to fix. – Adam Spriggs May 09 '22 at 14:59
  • Hi @AdamSpriggs, I tried to insert the following code in the FromEmail adress field in Sender Profile `%%[set @accountname = AttributeValue("Opportunity:Account:Name") if not empty (@accountname) then set @FromEmailAddress = CONCAT(@accountname, "@email-3Dagency.com") else set @FromEmailAddress ="@email-3Dagency.com" endif ]%% %%=v(@FromEmailAddress)=%%` but it still didn't work (the sender profile couldn't be saved). I had also tried to insert this code in a content block and to fill the FromEmailAdress field using the function%%=ContentBlockbyKey("myContentBlock")=%% but sent didn't work – Lamia Hafid May 10 '22 at 13:36
  • I'd definitely include an else in your if-statement. If it's not working your `accountName` likely doesn't have a value. – Adam Spriggs May 10 '22 at 14:09

0 Answers0