I'm trying to setup a dynamic sender profile by only changing the Sender Name based on my records sales rep. I have 2 basic data extensions I need to use, one being my sales rep table as a reference, and the table I am sending to.
My sending table:
SubKey | Salutation | Name | |
---|---|---|---|
12345 | Dr. | John Doe | [email protected] |
12346 | Dr. | Jane Doe | [email protected] |
My sales rep reference table:
Name | Phone | SubKey | |
---|---|---|---|
Sailor Jerry | [email protected] | 123-456-7899 | 12345 |
Pirate Pete | [email protected] | 321-654-9987 | 12346 |
The SubKey is the similar column between the two tables. I am trying to perform a Lookup and pull the Name from my Sales Rep table and paste the name in the sender profile.
This is the AMPscript i'm gaving trouble with:
%%[
var @SubKey, @SubscriberKey, @SalesRep
set @SubscriberKey = [SubscriberKey]
set @SubKey = Lookup(“SendingTable”,”SubKey”,”SubKey”,@SubscriberKey)
set @SalesRep = Lookup(“SalesTable”,”SubKey”,”SubKey”,@SubscriberKey)
set @SalesRep = ProperCase(@SalesRep)
IF Empty(@SalesRep) THEN SET @SalesRep = “Captain Kangaroo” ENDIF
]%%
%%v=(@SalesRep)=%%
I plan on having the above AMPscript as a snippet, and in the sender profile to pull it by using the ContentBlockbyKey to print out the results in the sending name.
How can I make this AMPscript work to pull my SalesRep name that's associated with the record I'm sending to?