I am trying to pull the FromAddress and FromName, from a data extension but am not having much luck.
I have setup a sender profile that looks like this:
From Name: %%=v(@fromName)=%% From Address: %%=v(@fromAddress)=%%
My Data Extension Looks like this:
brandcode fromname fromaddress
The Ampscript in my email template looks like this:
Var @fromname, @fromaddress, @brandcode, @row, @rows, @rowcount Set @brandcode = AttributeValue("Brandcode") Set @rows = LookupRows("senderinfo", "brandcode", @brandcode) set @rowCount = rowcount(@rows) if @rowCount > 0 then set @row = row(@rows,1) set @fromname = field(@row,"fromname") set @fromaddress = field(@row,"fromaddress") ENDIF
What I am trying to do is this.
IF Brandcode = AA Then use the fromname and from address for AA IF Brandcode = BB then use the fromname and from address for BB
My code validates but it uses the "default" sender info and is not using the lookup.