Easymailing
Automation triggers

Update a time since last purchase trigger

PUT /automations/{automationUuid}/automation_triggers/{uuid}/time_since_last_purchase

PUT/automations/{automationUuid}/automation_triggers/{uuid}/time_since_last_purchase

Changes an existing time since last purchase trigger by replacing its settings with the values you send. The trigger keeps its type, its enabled or paused state and its counters.

When to use: To change the store or how long after the order the automation starts.

When not to use: To add a new time since last purchase trigger to an automation, use create_trigger_time_since_last_purchase. Call this operation only on a trigger whose trigger_type is trigger.time.since.last.purchase: the API does not check it, and sending the wrong kind replaces the settings of a trigger of another type with settings that do not fit it, which can break it. To change the type, delete the trigger with delete_automation_trigger and create the new one; to stop it for a while, use automation_trigger_pause.

Side effects: The configuration is replaced as a whole: fields you omit go back to their defaults, so workflow_repeat becomes false if you leave it out. The new settings apply to events from then on.

Permissions: Requires the author role or higher, or the marketing.automations.write capability.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Path Parameters

automationUuid*string

UUID of the automation, as returned by list_automations.

uuid*string

UUID of the trigger, as returned by list_automation_triggers.

Request Body

The updated AutomationTrigger resource

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X PUT "https://api.easymailing.com/automations/0df14405-90ff-4287-b3e4-ef088901ee6f/automation_triggers/9c2e7a14-6b3d-4d58-8f1a-5e0b3a7c4d21/time_since_last_purchase" \  -H "X-Auth-Token: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "store": "/entity/1",    "delay_value": 0,    "delay_unit": "hour",    "workflow_repeat": true  }'
{  "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",  "automation": "/entity/1",  "trigger_type": "trigger.admin.manual",  "active": true,  "workflow_repeat": true,  "trigger": null,  "count_automation_queues": 0,  "count_completed_automation_queues": 0,  "count_queued_automation_queues": 0,  "count_canceled_automation_queues": 0}