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
executeAction(ActionID: string, [Context: any, [At: Date]]) : FiveError;
Parameter | Type | Default | Description |
---|---|---|---|
ActionID | string | ActionID for the Mail Merge or Process. | |
Context | Map<string,any> | null | Optional map of string to values. |
At | Date | null | Optional 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 Context | Description |
---|---|
The 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. | |
name | The name of the recipient. |
subject | Add a subject line for the email. |