0

I'm trying to set up a dynamic sender profile but something is wrong.

I've followed this solution step by step: Sender Profile AMPscript

But it doesn't work. Problem seems to be the from address, since the sender profile does not appear in the preview and test drop down list any longer as soon as I set a dynamic from address. If I set it static, with a verified address, and use the dynamic block for the from name only, the sender profile appears in the dropdown list again, but the email fails to arrive.

I've created a very simple dynamic block:

%%[ 

var @fromName 
var @fromAddress

set @a = 1
set @b = 2

if a == 1 then
 set fromName = "From Name 1"
 set @fromAddress = "[email protected]"
else
 set fromName = "From Name 2"
 set @fromAddress = "[email protected]"

ENDIF

]%%

I changed the email addresses for privacy purposes, but the ones I am using are correctly verified. And then added ampscript to my sender info fields:

%%[ContentBlockByKey("sender-profile")]%%%%=v(@fromName)=%%
%%[ContentBlockByKey("sender-profile")]%%%%=v(@fromAddress)=%%

I can't see any error in the code. Is there anything I am missing?

Any help would be much appreciated.

Thanks

2
  • There is an error in your If statement, it should be if @a == 1. Also in the set statments Commented Nov 11, 2020 at 9:29
  • True, but still not working.
    – robruf
    Commented Nov 11, 2020 at 9:46

2 Answers 2

0

First of all, Make sure this feature is enabled in your account Your code has syntax issues.

 %%[
var @fromName 
var @fromAddress

set @a = 1
set @b = 2

if @a == 1 then
 set @fromName = "From Name 1"
 set @fromAddress = "[email protected]"
else
 set @fromName = "From Name 2"
 set @fromAddress = "[email protected]"

ENDIF

]%%
%%=v(@fromAddress)=%%

And then used %%=ContentBlockbyId("ContentID")=%% in the from email under sender profile.

10
  • True, but still having the same problem.
    – robruf
    Commented Nov 11, 2020 at 9:45
  • Updated Answer above Commented Nov 11, 2020 at 9:54
  • Ok, I am seeing the sender profile in the dropdown list now, but when I send the email, it never gets delivered. This is what is shown in the tracking: ibb.co/HVgFY5Q
    – robruf
    Commented Nov 11, 2020 at 10:01
  • Try to test your code snippet in an email to see whether you get an ampscript error Commented Nov 11, 2020 at 10:03
  • Code works fine, no errors. The variable is shown correctly...
    – robruf
    Commented Nov 11, 2020 at 10:49
0

have you tried wrapping your ContentBlockByKey() call within a TreatAsContent()? I believe something like this might help.

%%=TreatAsContent(ContentBlockByKey('ContentID'))=%%

Also, I believe that all the dynamic from email addresses you're wanting to use need to use the approved domain for your account. Judging by your code, it appears that you're trying to use the domain email.com in your dynamic from email addresses. Since email.com isn't the approved domain for your account I imagine that's why your emails are probably failing.

If you navigate to Admin > Send Management > Sender Profiles > Default you can look at the From Email field to see what domain is used on your account. And as long as the dynamic from emails you're trying to use share that same domain.com then it should send for you. Otherwise I believe the email fails on the backend. Well, I hope this information helps in someway. Best of luck!

You must log in to answer this question.

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