executeAction()
Last updated 11/09/2024
The
executeAction()
is a function on the Five
object that executes an action on either the Five server or the client. The
context
parameter 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, Processes, and Reports.
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: FiveError) => void]) : FiveError;
Parameter | Type | Default | Description |
---|---|---|---|
actionID | string | Action ID for the mail merge, the process, or the report | |
context Optional | Map <string,any> | null | Map of string to values |
at Optional | TimeStamp | null | Future timestamp that you want the action to execute at |
onResult Optional | function | null | Function to execute when the action completes |
Mail Merge Reserved Context Options
When using a 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 whom the email originates from |
SMTPFromEmail | Email for whom the email originates from |
SMTPToName | Name for whom the email is being sent to |
SMTPToEmail | Email for whom the email is being sent to |
SMTPSubject | Subject line for the email |
SMTPBody | Body for the email |
SMTPAttachments | Contains the attachments to be added to the mail merge |
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 |