Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

How to schedule a delivery from a script Activity in Campaign Classic

Avatar

Level 2

Hi,

We have a requirement to schedule a Delivery based on Recipient Timezone. This needs to be achieved programatically, (In a script activity) based on our existing design.
Currently, we have below code snippet which triggers the delivery.

var emailTemplate = "del001" //internal name of Delivery Template
var recipientID = "6784568"
nms.delivery.SubmitNotification(emailTemplate,
<delivery>
<targets>
<deliveryTarget>
<targetPart exclusion='false' ignoreDeleteStatus='false'>
<where>
<condition expr={'@id ='+recipientID}/>
</where>
</targetPart>
</deliveryTarget>
</targets>
</delivery>);


We have updated the XML Payload as below by adding  </scheduling> and anticipated that it would schedule a delivery. But it didnt work. 

var emailTemplate = "del001" //internal name of Delivery Template
var recipientID = "6784568"
nms.delivery.SubmitNotification(emailTemplate,
<delivery>
<scheduling contactDateTimeZone="Europe/London" contactDate="2021-09-02 05:05:00.000Z" delayed="1" extraction="2021-09-02 05:00:00.000Z" validationMode="auto" validityDate="2021-09-07 05:05:00.000Z" webResPurged="false">
<waves mode="0" splitDelay="86400" splitSize="20%"/>
<messagePreparation _login="" forecasted="0" priority="0"/>
</scheduling>
<targets>
<deliveryTarget>
<targetPart exclusion='false' ignoreDeleteStatus='false'>
<where>
<condition expr={'@id ='+recipientID}/>
</where>
</targetPart>
</deliveryTarget>
</targets>
</delivery>)


Let us know what would be key attributes on Delivery & Scheduling to make it perfect and how we can acheive this in Adobe Campaign Classic.

TIA!

 

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi @mrudulm9146324 ,

The timezone for "Asia/Calcutta" is (GMT+05:30). Refer xtk:common:timezone

You can check the delivery schedluing section.

For Example:

Malarrajan_Sundarraj_0-1631108006325.png

 

- Malarrajan Sundarraj

 

View solution in original post

7 Replies

Avatar

Community Advisor

Hello @mrudulm9146324,

execute delivery and see the scheduling.
I have something like

<scheduling IPAffinity="default" contactDate="2021-08-05 12:26:37.169Z" contactDateTimeZone="Europe/Zurich"
              delayExtraction="0" delayed="0" expectedBudget="" expectedContent=""
              expectedEdition="" expectedExternal="" expectedExtraction="" expectedFCP=""
              expectedForecast="" expectedTarget="" extracted="" extraction="" reminderBudget=""
              reminderContent="" reminderEdition="" reminderExternal="" reminderExtraction=""
              reminderFCP="" reminderForecast="" reminderTarget="" validationMode="manual"
              validityDate="2021-08-10 12:26:37.169Z" webResPurged="0" webValidityDate="2021-10-04 12:26:37.169Z">

I can see some of the attributes you are missing in yours but no idea if that will do the trick


Have you tried to do it inside workflow with split by time zone and compute the wait time  according to the time zone?


Or even split all the time zones to separate workflows?


Also I assume you send this not only for one recipient but in bulk right?

 

Marcel

Thanks for the Response, Marcel.
Yes i have tried with above mentioned Attributes and no luck & yes, it is a bulk delivery and the each recipient in the list would be from different timezone.

Have you tried to do it inside workflow with split by time zone and compute the wait time  according to the time zone? Or even split all the time zones to separate workflows?

-
Could you please share snippet if you have? As per current design we are preferring to trigger this from the Script.

Avatar

Level 3

Hello @mrudulm9146324 ,

 

Here the code to schedule the delivery using javascript

 

var xmlTargeting = <delivery>

  <targets >

    <deliveryTarget>

      <targetPart exclusion='false' ignoreDeleteStatus='false'>

        <where>

          <condition expr={'@id=' + rId}/> // Recipient ID

        </where>

      </targetPart>

    </deliveryTarget>

  </targets>

</delivery>;

var finalDev = nms.delivery.CreateFromModel(template, xmlTargeting); // Delivery internal name ( Template )

var deliv = nms.delivery.create(finalDev);

deliv.scheduling.delayed=1;

deliv.scheduling.contactDate = formatDate(getOption('TestExecutionDate'), "%4Y-%2M-%2D %2H:%2N:%2S"); //scheduling date 

deliv.scheduling.validationMode = "auto";

deliv.validation.useBudgetValidation = false;

deliv.validation.useContentValidation = false;

deliv.validation.useTargetValidation = false;

deliv.validation.useFCPValidation = false;

deliv.content.sms.source='Hi Welcome';

deliv.operation_id=campId;
 

deliv.save();

nms.delivery.PrepareFromId(deliv.id);

 

- Malarrajan Sundarraj

Thanks @Malarrajan_Sundarraj !
We are able to schedule. Along with contactDate we are also trying to trigger based on TimeZone.
For Ex: If we have contactDate Value as 7th Sept 2021, 6PM it should deliver based on the set Timezone
(If it is IST - it should trigger at 7th Sept 2021, 6PM IST)
But currently it is delivering at GMT 7th Sept 2021, 6PM. 
Below is the snippet. 
Any idea how we can achieve this ?
deliv.scheduling.contactDate = formatDate(getOption('ExecutionTime'), "%4Y-%2M-%2D %2H:%2N:%2S");
deliv.scheduling.contactDateTimeZone="Asia/Calcutta"

Avatar

Correct answer by
Level 3

Hi @mrudulm9146324 ,

The timezone for "Asia/Calcutta" is (GMT+05:30). Refer xtk:common:timezone

You can check the delivery schedluing section.

For Example:

Malarrajan_Sundarraj_0-1631108006325.png

 

- Malarrajan Sundarraj

 

@Malarrajan_Sundarraj  - Yes i got it. 
But while updating in the script i tried to update the value of the enum. (from xtk:common:timezone) that is 'Asia/Calcutta'

deliv.scheduling.contactDateTimeZone="Asia/Calcutta"

Should we rather update like this ?

deliv.scheduling.contactDateTimeZone="(GMT+05:30)"

Hello @mrudulm9146324,

 

The correct one is: 

 

deliv.scheduling.contactDateTimeZone="Asia/Calcutta"