0

I know this question was asked many times but I can't find an effective way to do it in my case.

After editing an email, normally I would do this to update that email in journey:

  • Click the email in journey, choose Activity Summary , then Select Different Message, reselect the same email, Done.

Or I can make a new version of the journey and active it.

The thing for this is that I'm working with many emails and journeys (over a dozen of journeys and up to 20 emails in each journey). It's really painful doing them manually!

FYI: my emails which I am working with are associated with product brands, therefore many of them may have the same header/footer/body (reference content in Content Builder). Every change was made would have an effect on them.

Note: This "old cache issue" also happens in Automation. I have had an experience with that. E.g. I have a SQL query which was targeted to a Data Extension. If I add a new field to the DE, then modify the SQL to query the new field and run it. The new field won't be queried until I reselect the DE in the query activity.

What is the best approach for my case?


*EDIT:

Based on clue of @Macca and the answer of @fmielke. I created a Script Activity and ran it. It works better than expected, every active trigger (include journey triggers) was refreshed. Just need to add the lack part </script> at the end of @fmielke code.

1
  • 2
    If you create a new version of the Journey and activate it, changes to any email in the journey are applied to the newly created triggered sends. Programatically, you can republish all the triggered sends in the running version of the Journey using API/SSJS. See salesforce.stackexchange.com/questions/174380/… for sample code to republish triggered sends. You'd need to do a retrieve on the _JourneyActivity data view to get the sends in the Journey concerned. It's a fair bit of work. BTW, Reference Content Blocks aren't cached.
    – Macca
    Aug 4 at 6:48
1

Something that's a bit faster is using the old Triggered Send style update.

Email Studio / Interactions / Triggered Emails

then on the left:

Messages / Journey Builder Sends / Your Journey / Latest Version

And then go through the mails using Pause >Publish > Start / Restart

You can at least do this for all Emails in one Journey Version at a time plus you will have much less loading time compared to JB.

0

Here is my answer for the question.

Prepare data:
I would need to collect external keys of email triggers from journeys. In my case, I need to refresh email contents from running journeys.
Can take a look how I prepared my data extension from this Post where I collected external keys from running journeys.
Note: I named my data extension "Email tsd from JB" and use Remark column field to call rows from this DE.

Process data:
Based on this great Post of Gortonington and fmielke's answer. Now I can mimic steps to refresh email triggers like Jonas's answer by API function.

<script runat="server">

Platform.Load("Core","1.1.1");

// Get data
var init_array = [];
var myDEName = "Email tsd from JB";
var data = Platform.Function.LookupRows(myDEName, "Remark", "Refresh");
if(data.length > 0) {
    for(var i=0; i<data.length; i++) {
        init_array.push(data[i].TriggeredSendCustomerKey)
    }
}
Write("Check array " + Stringify(init_array) + "<br>");
if (init_array.length >0) {

// Create a retrieve request
var rr = Platform.Function.CreateObject("RetrieveRequest");
Platform.Function.SetObjectProperty(rr, "ObjectType", "TriggeredSendDefinition");
Platform.Function.AddObjectArrayItem(rr, "Properties", "CustomerKey");


// Create a filter
var sfp = Platform.Function.CreateObject("SimpleFilterPart");
// by Customer Key (External Key) Array 
Platform.Function.SetObjectProperty(sfp, "Property", "CustomerKey");
Platform.Function.SetObjectProperty(sfp, "SimpleOperator", "IN");
for(var i = 0; i< init_array.length; i++) {
    Platform.Function.AddObjectArrayItem(sfp, "Value", init_array[i]);
}  

// Add the filter to the retrieve
  Platform.Function.SetObjectProperty(rr, "Filter", sfp);
  
// Do the retrieve
var StatusAndRequestID = [0,0];

var tsd = Platform.Function.InvokeRetrieve(rr, StatusAndRequestID);


// Check Status
Write("Status: " + StatusAndRequestID[0]);
Write("<br>RequestID: " + StatusAndRequestID[1]);
Write("<br>Tsd has " + Stringify(tsd.length) + " row/rows");

// Process Data
if (tsd != null) {
    for (var i = 0; i< init_array.length; i++) {
        var tsd = TriggeredSend.Init(init_array[i]);

        var pause = tsd.Pause();        
        var publish = tsd.Publish();
        var start = tsd.Start();
    }
}

}
</script>

(I put this on a cloudpage to check logs and debug)

I don't try to refresh all triggered send definitions but email triggers from running journey. Since it's only what I wanted to do and I have experienced that refreshing all triggered send definitions will cause critical issues to my journeys (makes some/most journeys stop working and I still don't know the reason).

Note: If you feel that you can improve my code above, feel free to say it out, I would love to hear. Thanks a lot.

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.