Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to change a subject line script into an actual subject line in the broadlog

akashaj7696
Level 3
Level 3

Hi Everyone,

 

I have a high priority situation wherein i need some help from you guys-

 

I have a script which pulls in subject line dynamically and in the delivery subject field (let's say the script is <%=subjectline%>) but when i look into the delivery/emailHeaderParameters/@subject it shows me exact script instead of the actual subject line which went to a recipient.

 

Is there a way to convert it into an actual subject line in the broadlog subject field?

 

@Sukrity_Wadhwa - Please suggest.

 

Thanks,

Akash

10 Replies
Darren_Bowers
Community Advisor
Community Advisor

Hi @akashaj7696 - You don't mention the context for this or why you need this. Generally speaking, you cant accurately reconstruct the subject line from the template at a later date as you don't know if the data that was used in the targeting for the delivery is still current. If the underlying target data changes, so does the dynamic subject line script.

If you store the data attributes used in the subject in the broadLog at the time of the delivery, you could do this accurately as well.

If the underlying data hasn't changed, then you can just re-run the targeting based on the recipient(s) in the broadLog you wan to get the subjects for, enrich in the data you require and reconstruct the subject line using the new target data in Javascript.

Cheers

Darren

akashaj7696
Level 3
Level 3
Hi Darren, let me explain- So i have one delivery where i have a script in the subject field (if segment='A', subject='B' else subject='C') This script works perfectly for the end user who will receive the email, however, when i try to check in the [delivery/mailParameters/subject] field i see the exact script which i wrote in the subject field of delivery. I want to know a way to capture the actual computed result of script into the subject field instead of the script. Also, is there any schema or place in ACC where we can check for a particular email what is the exact thing a end user has received, broadlog is one such but it's not acting useful in this case, let me know if you have any in mind, Thanks
Darren_Bowers
Community Advisor
Community Advisor

Hi @akashaj7696 - you can compute the subject during the workflow and create a workflow attribute to store the subject. Then in the delivery you just put the variable that you computed earlier. This way you can extend the broadLog schema and store the subject so you can find it again in the broadLog. Once common way to see what the email subject you sent was is to use the same text in the HTML <title> or in some preview header text. That way you can pull up the MirrorPageUrl and look at the title in the window - that would then show you the email subject. Cheers

akashaj7696
Level 3
Level 3
Appreciate your response. But can we try something inside the delivery to achieve this requirement? As i'm not talking about 1 campaign it will be 100s and hardcoding subject lines in variables for each campaign will be risky and less efficient
Darren_Bowers
Community Advisor
Community Advisor

Hi @akashaj7696 - I'm not sure what you mean by "try something inside the delivery"? @wodnicki has given you a response above on how to store the computed subject in the BroadLog. Unfortunately this is the only way to retrieve it after the delivery have been sent. Does this help you get what you need? Cheers

akashaj7696
Level 3
Level 3
HI Everyone, This all solution helps. But i need to know where the data gets stored which is computed during the execution of the delivery?
Darren_Bowers
Community Advisor
Community Advisor
@akashaj7696 - I'm not sure its stored anywhere. I would expect it is calculated on the fly by the SMTP send email function using the data + subject formula and fired off as part of the email
Jonathon_wodnicki
Community Advisor
Community Advisor

Hi,

 

Follow these steps:

  1. Add an @subjectLine attribute to nms:broadLogRcp with schema extension
  2. Add a storage field to recipient target mapping, $string([vars/@subjectLine]) -> @subjectLine
  3. Use delivery variable named to match mapping. You can also use a field in targetData instead of variable, just make sure mapping matches.

NB this can get expensive storage-wise so be mindful of database sizing and lower retention/increase disk space as appropriate.

 

Thanks,

-Jon

akashaj7696
Level 3
Level 3
Hi Everyone, Can someone think, if we can use control typology rules to achieve this where in a JavaScript code could be written and for each recipient this code will be ran and the value of subject be stored under delivery.mailParameters.subject field? I'm just not that good yet with JS so need help, please people who have good experience with JS and ACC please give it a shot. Thanks... I would really appreciate it.
Darren_Bowers
Community Advisor
Community Advisor

Hi @akashaj7696 - a subject that is unique to a recipient can't be stored under the definition for a delivery, because the delivery object doesnt contain all the data per recipient.

If you need to see the subject before you send the delivery you can enrich the subject using a formula onto the temporary schema in the workflow. If you need to see the subject after you send the delivery then you can add it to the broadLog as @Jonathon_wodnicki has described below. Cheers Darren