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