Skip to main content

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;

ParameterTypeDefaultDescription
actionID
stringAction 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.

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 whom the email originates from
SMTPFromEmailEmail for whom the email originates from
SMTPToNameName for whom the email is being sent to
SMTPToEmailEmail for whom 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()