3

I have a fairly odd use case here that I know SHOULD be possible, but I think I am missing something. The use case can break down to: I need a way to publish the TriggeredSendDefinition (TSD) once a day to create a new jobID every day for our reporting tool. (Trust me I know there are better ways to do this, but those would require a complete rebuild of our tool - which is a hard pass.)

Basically, I need to be able to 'publish' (like the button in the UI) each triggered send, but through the API call instead of through the UI. Sounds like it should be easy, right? Well, I have spent hours pouring through the documentation and have had difficulty finding the appropriate property to toggle.

My guess is that it can be done either:

  1. By Pausing then Activating the TSD status
  2. Through the RefreshContent property

I am not very sure on my guesses though as I have not been able to verify if #1 works (and I get the feeling it doesn't...) and #2 sounds like it would be set to refresh automatically on every send, which could be even worse than it is now.

0
5

UPDATE

The below does work, BUT it actually does cause the issue I originally suspected it might - refreshing on every new instance of the triggered send.

I did find a new solution via SFMC SSJS triggeredsend functions:

var tsd = TriggeredSend.Init(tsdName);

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

This appears to work as I want and only publish once, rather than multiple times in a day as the 'RefreshContent' property produces.

By using the SSJS TriggeredSend functions, I can mimic the UI capabilities exactly and 100% automate via a Script activity interaction.


I finally found the answer. It was #2 (the RefreshContent property).

See below for sample SOAP envelopes to accomplish this:

Pause

<!--***pause***-->

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <soap:Header>
      <wsse:Security soap:mustUnderstand="1">
         <wsse:UsernameToken wsu:Id="UsernameToken-452336374" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>USERNAME</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Objects xsi:type="TriggeredSendDefinition">
        <!-- This section here is only necessary if you are targeting a Welcome Email within a Business Unit -->
            <Client>
               <ID>YOUR_MID</ID>
            </Client>
        <!--END-->
            <CustomerKey>TriggeredSend-customer-key-goes-here</CustomerKey>
            <TriggeredSendStatus>Inactive</TriggeredSendStatus>
         </Objects>
      </UpdateRequest>
   </soap:Body>
</soap:Envelope>

Publish

<!--***publish***-->

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <soap:Header>
      <wsse:Security soap:mustUnderstand="1">
         <wsse:UsernameToken wsu:Id="UsernameToken-452336374" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>MC_USERNAME</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Objects xsi:type="TriggeredSendDefinition">
        <!-- This section here is only necessary if you are targeting a Welcome Email within a Business Unit -->
            <Client>
               <ID>YOUR_MID</ID>
            </Client>
        <!--END-->
            <CustomerKey>TriggeredSend-customer-key-goes-here</CustomerKey>
            <RefreshContent>true</RefreshContent>
         </Objects>
      </UpdateRequest>
   </soap:Body>
</soap:Envelope>

Restart

<!--***restart***-->

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <soap:Header>
      <wsse:Security soap:mustUnderstand="1">
         <wsse:UsernameToken wsu:Id="UsernameToken-452336374" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>USERNAME</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Objects xsi:type="TriggeredSendDefinition">
        <!-- This section here is only necessary if you are targeting a Welcome Email within a Business Unit -->
            <Client>
               <ID>YOUR_MID</ID>
            </Client>
        <!--END-->
            <CustomerKey>TriggeredSend-customer-key-goes-here</CustomerKey>
            <TriggeredSendStatus>Active</TriggeredSendStatus>
         </Objects>
      </UpdateRequest>
   </soap:Body>
</soap:Envelope>
2
  • 1
    Nice work, @Gortonington! Mar 22 '17 at 18:15
  • Nice work, @Gortonington!
    – mario ruiz
    May 11 '18 at 14:15

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.