Skip to main content

executeAction()

Last updated 14/6/2021

executeAction()

The executeAction() is a function that is used to execute an action on the Five server. The context holds the fields defined on the mail merge or process actions, as well as additional options defined by Five. Currently supported actions are Mail Merges and Processes.

Available
Server


Function Signature
executeAction(ActionID: string, [Context: any, [At: Date]]) : FiveError;


ParameterTypeDefaultDescription
ActionIDstringActionID for the Mail Merge or Process.
ContextMap<string,any>nullOptional map of string to values.
AtDatenullOptional At parameter for a future date and time that you want the action to execute at.


ActionID must be the Action ID of the action you wish to execute.

Context is an optional map of name and value pairs which can be inserted in a mail merge or used in a process.

At is an optional timestamp for when you wish to execute the action in the future. If the timestamp is in the past an error will return.

Five Reserved Context Options

When using the Mail Merge action, the optional context values of email, name and subject can be passed into the function for a single email to be sent. This eliminates the requirement to use a query on the mail merge to obtain the data.


Optionalย ContextDescription
emailThe email address, to enable a simple way to send a single email to one recipient instead of using a query to retrieve email addresses for a bulk mail merge, enabling a simple way to send a single email.
nameThe name of the recipient.
subjectAdd a subject line for the email.

Examples

executeAction()