Skip to main content

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;

ParameterTypeDefaultDescription
actionIDstringAction ID for the mail merge or process
contextMap <string,any>nullOptional map of string to values
atTimeStampnullOptional future timestamp that you want the action to execute at
onResultFunctionnullOptional 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.


PropertyDescription
SMTPServerHost name of your email provider server
SMTPPortPort number of your email provider server
SMTPUserNameUsername for your account
SMTPPasswordPassword for your account
SMTPFromNameName for who the email originates from
SMTPFromEmailEmail for who the email originates from
SMTPToNameName for who the email is being sent to
SMTPToEmailEmail for who the email is being sent to
SMTPSubjectSubject line for the email
SMTPBodyBody for the email
SMTPCcAddressesTakes an array of objects which contain an email address and optional name
SMTPBccAddressesTakes an array of objects which contain an email address and optional name
SMTPAddressesTakes an array of objects which contain an email address and optional name

Examples

executeAction()