I’m trying to capture the emails subject in the send log. Is there any way for me to do this?
To the ‘experienced’ community members: Not sure how to rephrase this any better. Maybe you could tell me what exactly is unclear so I can clarify. Yet I’ll try anyway.
I created a send log Data Extension with the following Fields:
JobID, ListID, BarchID, SubID, TriggeredSendID, ErrorCode, view_email_url.
I’d like to add another field like, ‘subject’ which represents the subject of the particular email being logged / sent. However, I am unable to capture that information. It doesn’t look as if any of the personalization strings can be used.
@Kelly-J-Andrews hints at the ability to do this in the comment on the this answer.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
As previously suggested, you could use an AMPScript variable for your subject.
%%[ var @subject set @subject = "This is the subject" ]%%
In your send definition the subject would be: %%=v(@subject)=%%
In your Send Log DE, you’d have to have a column named “subject”
If you’d rather not use the Send Log and email scripting, the subject is available in the System Data Views and is accessible via Query Activity.
For a particular send, you can query the EmailSubject
and DynamicEmailSubject
columns. I’d recommend building your query starting with _Job and then inner joining to _Sent based on the JobID (aka the SendID from the Tracking tab). I typically use _Job.PickupTime to narrow it down by date. Something like this:
select j.emailName , j.EmailSubject , j.DynamicEmailSubject , s.SubscriberKey , s.EventDate from _job as j with (nolock) inner join _sent as s with (nolock) on (s.jobid = j.jobid) where j.pickuptime >= dateadd(day,-7,getdate())
You can also join this back to your Send Log if you’d like (by JobID).
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0