1

I need to create an automation to:

1- Send and Email (from a created email template) to subscribers and informations from a Data Extension DocCobranca.

2- After 2 days has passed I need to make a check and send a second email ONLY for the subscribers who didn't open the first email.

This automation is scheduled to run every weekday. And I am going to receive new data that need to be sent every day (new subscribers)

The Mkt Clud org don't have Journey Builder. Only Automation Studio.

I have created the DocCobranca DE with the fields SendDate and OpenDate and JobId.

And have created 2 filtered DE

  1. DocCobrancaDE_NotSent > with the filter SendDate = Empty
  2. DocCobrancaDE_SentNotOpen > with the filter SendDate Not Empty + OpenDate = Empty

But I am having trouble to find out how can I fill those fields in the data extension once the original email have been sent.

How can I get the JobID form the sent email / the SendDate and OpenDate and fill the filterd data extension to be able to send the sencond email only who those who didn't open the fisrt one.

I have tried to use this SQL query activity to fill those atributes but no success:

s.SubscriberKey,
s.JobID,
s.BatchID,
convert(char(19),s.EventDate,20) as SendDate
from [_sent] s
left join [_open] o
on s.JobID = o.JobID and s.ListID = o.ListID and s.BatchID = o.BatchID and s.SubscriberID = o.SubscriberID and o.IsUnique = 1
where
s.JobID = JobID
and o.SubscriberID is NULL```

I am having trouble to get the JobId from the original email sent and fill it in the query. 

Can some one guide / help me in this Mkt Cloud issue. 









  • You can use the Data Views (help.salesforce.com/…) to retrieve that information using SQL Queries in the Automation, for example, to create the audience who will receive the second email, or to use it as a new criteria in your existing filter. – fromero Jul 17 at 6:36
0

I would first create a field called JobID inside your DocCobranca DE (gonna call this DC). Then use an AMPscript Upsert inside the email to insert the JobID and 'SentDate' into the DE.

For example:

UPSERT("DocCobranca",1,"SubscriberKey",_SubscriberKey,"JobID",jobid,"SentDate",NOW())

Now if you are going to be including multiple iterations of each subscriber, you will need a second or third primary key in your DE and will need to adjust the above accordingly.

This will get you the JobID and the exact Date/Time it was sent. From there you utilize your query above (can remove the _Sent DV stuff) to fill in the Open times.

Something like:

SELECT   dc.SubscriberKey
       , op.EventDate as OpenDate
FROM [DocCobranca] dc
INNER JOIN [_Open] op
ON dc.JobID = op.JobID AND dc.SubscriberKey = op.SubscriberKey

You then utilize your filters, etc. as sendable and suppression lists, etc.


Now for your current situation, your only bet is to go from Job DV using the 'EmailName' and possibly the DeliveredTime (can convert to just date via SQL) to collect the appropriate JobID for your send.

For example: (assuming that the email was named: 'SkullHeadFace' and it was sent on 7/15/2019)

SELECT j.JobID
FROM [_Job]
WHERE EmailName = 'SkullHeadFace
AND CONVERT(varchar,'07/15/2019', 101) = CONVERT(varchar, DeliveredTime, 101)

This will get you the appropriate JobID to then use your query in your question to add in the sent/open info.

  • Thank you very much for you help! with few adjustments in the query I could get what I need to do the job. – Carolina Jul 17 at 22:41
  • The query in case someone needs: Select distinct dc.Email, dc.Cliente, dc.CNPJ, dc.GrupoEmail, dc.notasfiscais, dc.billingUrl, dc.attachmentName, dc.identificadorEnvio, dc.JobID, dc.BatchID, dc.SendDate, dc.OpenDate, dc.SubscriberKey FROM [Doc Cobrança] dc WHERE NOT EXISTS (SELECT * FROM [_open] o WHERE o.SubscriberKey = dc.Email AND o.JobID = dc.JobID ) AND NOT EXISTS (SELECT * FROM [_bounce] o WHERE o.SubscriberKey = dc.Email AND o.JobID = dc.JobID ) – Carolina Jul 17 at 22:42
  • And the AMPScript I have used in the email: UpsertDE("Doc Cobrança",2,"Email", @emailAddress, "identificadorEnvio", @idIdentificador, "SendDate", @updatedDate, "JobID",jobid, "OYBAccountID",SubscriberID) – Carolina Jul 17 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.