So this is essentially the same question as AMPscript Variables in Preheader. However, when I follow the individual's steps, I'm still not able to populate the dynamic preheader. In fact, now I can't seem to get my dynamic subject to populate. In preview in Email Studio, it looks fine, however when I send it the subject line appears as =v(@Subject)=%%
.
Clearly, I'm missing something, I just can't seem to figure out what. I put my block AMPscript (below) at the top of the email in a code snippet. Is it because I'm looking up the values in a non-sendable Data extension?
%%[
Var @Subscriber_Key, @Premise_Number, @Campaign_ID, @Preferred_Language, @first_name, @debtor_number, @RAF_ID, @preheader, @Subject
Var @rows, @row
Set @Subscriber_Key = AttributeValue("Subscriber_Key")
Set @Premise_Number = AttributeValue("Premise_Number")
Set @Campaign_ID= AttributeValue("Campaign_ID")
Var @rows1, @row1
Set @rows1 = LookupRows ("DE_TX_Welcome_Series_PROD_DE", "Subscriber_Key", @Subscriber_Key , "Premise_Number", @Premise_Number, "Campaign_ID", @Campaign_ID)
if RowCount (@rows1) > 0 then
Set @row1 = Row (@rows1,1)
Set @RAF_ID = Field(@row1,"RAF_ID")
endif
Var @rows2, @row2
Set @rows2 = LookupRows ("DE_Master_DE", "Subscriber_Key", @Subscriber_Key)
if RowCount (@rows2) > 0 then
Set @row2 = Row (@rows2,1)
Set @First_Name = Field(@row2,"First_Name")
Set @Preferred_Language = Field(@row2,"Preferred_Language")
Set @debtor_number = Field(@row2, "debtor_number")
endif
IF @Preferred_Language == "ENGLISH" THEN
SET @Subject = "Welcome to company"
SET @Preheader = "Learn about all the benefits of being a company customer"
ELSEIF @Preferred_Language == "SPANISH" then
set @Subject = "Bienvenido a company"
Set @Preheader = "Conozca todos los beneficios de ser un cliente de company"
endif
]%%