I have a doubt with regards to Code Snippet VS AMPScript. To give bit of a context:
I have a campaign to run biweekly with a new discount code. Until now, every week i was going and manually making edits to every email content and more. I realised as i have all information of what the discounts are going to be in the future, i could create a code snippet and populate information via using flag in my query to get users the right content. And i used this code snippet by contentblockid in my ampscript and i marked the variables as ",@content_discount," but it was not populating the fields rightly.
Set @subHeadlineTop = concat("Get ",@content_discount," off") Set @subHeadlineTop = concat("Get", ",@content_discount,", "off") But it did not work until. The same thing in subject line worked fine, but in the content part body/header it did not render.
Only when i used %%v=(@content_discount)=%% it populated the content. Set @subHeadlineTop = Concat("Get %%=v(@content_discount)=%%" , " off")
Could someone explain why?
The 2nd way i went about was defined attributes/variables and set all the content in the code snippet and pulled it to the email. And in the code snippet i used like this ",@content_discount," and it worked like magic.
Is there a difference of using these two that i am not aware off? I am a newbie to this, and any kind of clarity here would be of great help.