For my segmentation purpose, I am using a personalization block in my email delivery's subject line. Inside this personalization block, I am doing a soap call to fetch the subject appropriate for my segment. However, if after evaluation, if I get 'Hi <%= recipient.firstName %>' this recipient firstName part is not getting evaluated, rather i am getting the subject as 'Hi <%= recipient.firstName %>' not as 'Hi Jessie' (considering 'Jessie' is the recipient's first name).
Anyone has ever tried something like this? Any idea what I am doing wrong here?
In case it is of any interest to anyone, I was looking for a solution to this.
So I manually searched and replaced the string that comes with personalization vars, similar to the following:
(This assumes that instead of <%= and %> the string comes with %JS_START% and %JS_END%. The reason I do this is that I want to _paste_ this code into a string, and having %> in a string will escape away from the _whole_ script)
vardynamicSL="%JS_START% recipient.firstName %JS_END%, today is %JS_START% formatDate(new Date(), '%Al')%JS_END%.";
supratim320 Did you ever manage to find a solution for this issue? I'm facing the same problem. I'm pretty sure that eval'ing the string 'Hi <%= recipient.firstName %>' won't work, so I'm looking into building a search-and-replace kind of solution where I check for probably just '<%='.
I'm not 100% sure that personalization blocks can be inserted in subject lines, but you can still use variables as Marjorie explained, as well as conditionality (Conditional content). Would that be enough as a workaround?
As stated, I am using a personalization block within the 'Subject' line, so I cannot mention subject module as you've mentioned. In my personalization block, I am driving various logic and deciding on final o/p and I am evaluating the subject. At the o/p of my personalization block, I am getting output = 'Hi <%= recipient.firstName %>' and then I am using <%=subject %>, I am not getting 'Hi Jessie', instead I am getting 'Hi <%= recipient.firstName %>' - in a nutshell, using personalization block, it is not evaluating the tags