I've been following Sprigg's helpful lookup documentation and I can pull the right fields that I need into the email. Here is the code:
%%[ var @FromName, @lookupValue
set @lookupValue = AttributeValue("Lookup") /* value from attribute or DE column in send context */
set @FromName = Lookup("DEname","ColumnName","Lookup", @lookupValue) ]%%
%%=v(@FromName)=%%
I'm using this to get the variable for use within the sender profile which I populate with:
%%=ContentBlockbyKey("Keyname")=%%
I then build my email with the code snippet block inserted into my email.
My issues stem from the fact that my preview and testing is very inconsistent. Sometimes I receive the email with the right FromName
and EmailName
. Other times it defaults to the default sender information and other times I don't get an email at all.
I'm using two blocks to give my both my FromName and FromEmail variables and after attempting to get it right for a week, I don't know where I'm going wrong.
My hope is to get this going and then try to figure out how to also create a 3rd variable for dynamic reply to email.
Being new to AMPscript it's hard to pinpoint where I'm going wrong and if what I'm trying to achieve is possible.
Any insight?