Test automation
Walks the copy you edit once, now, for one address. Its emails are really sent, with "[Test]" before the subject. Waits are skipped, a wait for an event takes its no path, and steps that change contacts or call webhooks are skipped. Nothing is counted.
opensend.automations.test(id, input)opensend automations testInput
id goes first, on its own, and the rest in one object. One object that holds id works too.
idstringRequiredThe id of the item. Up to 64 characters.
emailstringRequiredWhere the emails of the test go. Up to 120 characters.
dataRecord<string, unknown>Data to run it with, as an event would carry.
Returns
The call resolves to the answer, already parsed. A call the API refuses throws OpenSendError with the code and the message of the answer. SDK lists the errors of the client itself.
object"automation_run"Always
automation_run.idstringThe id of the run.
automationIdstringThe id of the automation.
versionintegerThe version of the automation the run follows.
emailstringThe address of the person.
contactIdstring | nullThe id of their contact, or
nullfor a bare address.statusstringWhere the run stands:
running,waiting,completed,exited,failedorcanceled.One of
runningwaitingcompletedexitedfailedcanceledstepIdstring | nullThe id of the step it is at, or
nullonce it has ended.sourcestringWhat started it: the name of the event, or
schedule,date,manualortest.testbooleantruefor a test run.reasonstring | nullWhy it ended before the end of its path, or
null.One of
exit_stepgoalunsubscribedcontact_deletedautomation_deletedautomation_stoppedmissing_variablesend_refusedstep_failedcanceleddetailstringMore about how it ended. Empty while it is going on.
wakeAtstring | nullWhen a waiting run goes on, or
null.startedAtstringWhen the run started.
finishedAtstring | nullWhen it ended, or
null.dataRecord<string, unknown>The data of what started it.
stepsobject[]What each step did, oldest first.
steps[].idstringThe id of the step.
steps[].kindstringWhat the step does.
One of
send_emaildelaywait_untilwait_for_eventconditionbranchsplitupdate_contactdelete_contactadd_to_audienceremove_from_audiencewebhooksend_eventexitsteps[].namestringThe name of the step.
steps[].outcomestringWhat happened:
sent,done,waiting,waited,yes,no,skippedorfailed.One of
sentdonewaitingwaitedyesnoskippedfailedsteps[].detailstringMore about it, such as why it failed. Often empty.
steps[].emailIdstring | nullThe id of the email it sent, or
null.steps[].atstringWhen it happened.