executeAction()
Last updated 3/02/2024
The executeAction()
is a function on the Five
that is used to execute an action on the either on the Five server or the client. The context holds the fields as
defined by the action being executed, as well as additional options defined by Five or custom values defined by you.
Currently supported actions are Mail Merges and Processes.
Available
Client and Server
Function Signature Server Side
executeAction(actionID: string, [context: any, [at: Date]]) : FiveError;
Function Signature Client Side
executeAction(actionID: string, context: any, [onResult: (results: any) => void]) : FiveError;
Parameter | Type | Default | Description |
---|---|---|---|
actionID | string | Action ID for the mail merge or process | |
context | Map <string,any> | null | Optional map of string to values |
at | TimeStamp | null | Optional future timestamp that you want the action to execute at |
onResult | Function | null | Optional function to execute when the action completes |
Mail Merge 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.
Property | Description |
---|---|
SMTPServer | Host name of your email provider server |
SMTPPort | Port number of your email provider server |
SMTPUserName | Username for your account |
SMTPPassword | Password for your account |
SMTPFromName | Name for who the email originates from |
SMTPFromEmail | Email for who the email originates from |
SMTPToName | Name for who the email is being sent to |
SMTPToEmail | Email for who the email is being sent to |
SMTPSubject | Subject line for the email |
SMTPBody | Body for the email |
SMTPCcAddresses | Takes an array of objects which contain an email address and optional name |
SMTPBccAddresses | Takes an array of objects which contain an email address and optional name |
SMTPAddresses | Takes an array of objects which contain an email address and optional name |