Hi, I need your help.
The code runs fine when doing a Preview, but then breaks when Proofing.
These are the errors I get when trying to send the Proof:
These are the errors I see when visiting the proof details:
This is the JS code I use in the SL, you can see from the screenshot that the preview works and pulls data from the SQL statement.
Yes, I got it now. Thanks for clarifying.
Because all variables and methods of JS are not defined for Subject Line.
I tried to run some JS in the subject line and tried to fetch the data using queryDef, but got the below error :
js Error while executing the method 'ExecuteQuery' of service 'xtk:queryDef'.
It means that ExecuteQuery method is not available for Subject Line, That's why I conclude that we can't use complex JS in the Subject Line. I hope it helps.
yeah, it seems so. thanks for checking
that is an issue for us.
Hi Kapil and thanks for your reply.
I am not trying to display first name and last name on my Subject Line.
I am trying to figure out if I can run queries in the subject line to record which user received which dynamic content in Adobe Campaign.
Thus, I need to be able to run a query that saves data after my JS selects an SL to be displayed e.g. X user got Y SL.
I hope this is more clear now.
Can you please explain what exactly is your requirement to run SQL in the Subject Line ?
Because if you just want to Put Recipient's FirstName and LastName in the Subject Line, then just use the below syntax :
<%= recipient.firstName %>
Now if you will preview the delivery, it won't be showing the actual first name and last name of recipient, it will just show the syntax you have written there in the Subject Line.
But, if you will actually send the Delivery, it will take the First and Last Name of the recipient. You can verify that by sending the delivery to yourself first.