Send notification emails
  • 17 Jan 2024
  • 3 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Send notification emails

  • Dark
    Light
  • PDF

Article summary

List of Corezoid events for which notification emails are sent

There are seven types of system messages in Corezoid:

  • Password recovery
  • Registration confirmation
  • Invite a user to a company
  • Object sharing
  • Changing a user's password
  • Object download
  • Task download
  • Task upload error

After installing the system, you need to create and configure a process that sends these system messages or only some of them.

Depending on the action, an object with different parameters is sent to the process, among them there will always be two mandatory parameters:

  • type - email type
  • recipients : [{email}] - users’ emails for mailing

Optional parameter:

lang - user language - depending on it, you can prepare email templates in different languages. If a user has not selected a language, the default value will be lang = en.

MessageTask parameters
Password recovery
  • type = password_recovery
  • recipients = [{email}]
  • url - link for a password recovery
Registration confirmation
  • type = confirm_registration
  • recipients = [{email}]
  • url - link for registration confirmation
  • nick - username
  • lang - user language
Invite a user to a company
  • type = invite
  • recipients = [{email}]
  • company_name - if a user was invited to a specific company (not to My Corezoid), then the name of this company will be among the parameters
  • url - link for confirming an invitation
  • lang - user language
  • login - inviter login
Object sharing
  • type = share
  • recipients = [{email}]
  • company_name - if a shared object was created in a specific company, then the name of this company will be among the parameters
  • url - link to a shared object
  • lang - user language
  • login - inviter login
  • obj_type - shared object type (possible values: conv, folder, dashboard, instance, config)
  • obj_name, object_name - shared object name
  • obj_id - shared object ID
Changing a user password
  • type = expire_password_notify
  • recipients = [{email}]
  • reset_password_url - link to password reset
  • secs_to_expire - seconds until a password expires
Object download
  • type = download_complete
  • recipients = [{email}]
  • action_type = download (default)
  • obj_type = downloaded object type (possible values: folder, conv, dashboard, instance, config, alias, project, stage, version, api_gateway)
  • subject - default email subject
  • body - default email text
  • obj_id - downloaded object identifier
  • title - downloaded object name
  • create_time - download link creation date
  • url - download link
Task download
  • type = download_complete
  • recipients = [{email}]
  • action_type = download (default)
  • obj_type = file_download (default)
  • subject - default email subject
  • body - default email text
  • obj_id - ID of a process from which the task was loaded
  • title - process name
  • create_time - download link creation date
  • url - download link
  • proc = ok - system parameter
Task upload error
  • type = upload_complete
  • recipients = [{email}]
  • action_type = upload (default)
  • obj_type = task (default)
  • subject - default email subject
  • body - default email text
  • conv_id - ID of a process to which the task failed to upload
  • name - process name
  • create_time - creation date of the link for downloading the error file
  • url - link for downloading the error file
  • proc = ok - system parameter

Process example

image.png

  1. Add the Condition node after the Start node.

  2. In the Condition node, configure branching conditions for sending two types of messages: Invite a user to a company (type = invite) and Object sharing (type = share).

  3. Add the API Call node for every message type.
    Example of API Call node configuration.
    image.png

  4. Add an array processing sequence if an email has to be sent to multiple users:

    1. After the Condition node, add the Code node that will process the array of emails and decrease it each time a task is passed through this node. Paste the following code into the code editor (language: JavaScript):

      if (data.index == undefined) {
      data.index = 0;
      } else {
      data.index = data.index + 1;
      }
      data.length_recipients = data.recipients.length - 1;
      data.email = data.recipients[data.index].email;
      
    2. Connect the Code node to the API Call node.

    3. After the API Call node, add another Condition node to check the length of the array.

    image.png

    d. Connect the API Call node (2.2) to the Condition node (4).
    image.png

  5. Separate the sequence of sending emails that notify on downloading various objects and make object-specific texts for them: Add additional constituent conditions to node 1, and add the following nodes to the process: 2.3, 1.4, 2.4:
    image.png

You can supplement the process with individual sequence of nodes necessary for sending emails.

Adding Process ID to settings

After completing the process configuration, add the process ID to the capi_user_notify_conv setting of the Superadministrator menu, Settings section. To do that:

  1. In the upper-right corner of the page, click your profile image, and in the dropdown list, select Superadmin.
    image.png

  2. On the Settings tab, enter the process ID in the capi_user_notify_conv field.
    image.png


Was this article helpful?