[SalesForce] SFMC Ampscript subject line in automation from content builder

My email is located in Classic Content and repopulated on daily basis through API. I would like to automate this email and to make sure it uses correct email content and subject line every time it's going out. How do I retrieve email content, subject line…etc to make sure the content is up to day using ampscript?

Best Answer

Dynamic/Personalised Subject Line:

In Subject Line section of email:

%%=v(@Subject)=%%

In Email Body (either in HTML Template or Content Area):

%%[
VAR @Subject,@Date,@Name
SET @Date = FORMAT(DateAdd(Now(), "X","D"), "MMMM dd, yyyy")
SET @Name = Lookup("Customers","Name","SubscriberKey",_subscriberkey)
SET @Subject = Concat('Hi ',@Name,',The date is: ',@Date)
]%%

The subject line would be:

Hi JOHN, The date is: Saturday, April 1, 2017
Related Topic