Email notification for new patient registrations

Language: English

In this tutorial we set up an automation that emails the program coordinator each time a new patient is registered, entirely within ActivityInfo — no external workflow tool required. It uses ActivityInfo's built-in email step to send the notification.

We assume the role of a database administrator for a health program. Field teams register patients in a Patient Registration form throughout the day, and the program coordinator wants to be notified of each new registration as it happens.

What you need

  • A database with a Patient Registration form (any form will do — adjust the field references to yours). Ours has a text field Full Name with the code NAME, a quantity field Age with the code AGE, and a single-selection field Status with the code STATUS.
  • Permission to design the database.
  • The coordinator must be a user of the database, since email steps address database users and roles.

Step 1: Add the automation

  1. Open the database and select "Database Settings".

    Database Settings
    Database Settings
  2. Select the "Patient Registration" form.

    Patient Registration form
    Patient Registration form
  3. Select Automations in the form's detail pane and select Add automation.

    Add automation
    Add automation
  4. Name the automation "New patient registered".

    New automation
    New automation

Step 2: Choose the trigger

  1. Select Click here to get started.

    Click here to get started
    Click here to get started
  2. From the list of trigger types, choose On record added.

    On record added
    On record added
  3. Give the trigger a label, for example "Patient registered" and then select "Select form.

    Patient Registered Trigger
    Patient Registered Trigger
  4. Choose the Patient Registration form, and confirm with Select form.

    Select form
    Select form
  5. Select Done.

    Done
    Done

Step 3: Add the email step

  1. Select Add a new step.

    Add new step
    Add new step
  2. Select Action.

    Action
    Action
  3. Select Send email.

    Send email action
    Send email action
  4. Give the step a label, for example "Notify coordinator".

    Label the email action
    Label the email action

Step 4: Choose the recipients

  1. Select Manage recipients.

    Add email recipients
    Add email recipients
  2. Add the program coordinator. You can add individual users, or a role — a role reaches everyone who holds it, including people added to the role later. Confirm your selection and click "Save".

    Add email recipients by role
    Add email recipients by role

Step 5: Write the email

  1. Select Edit content.

    Edit content
    Edit content
  2. Enter the subject:

    New patient registered: ${NAME}
    

    ${...} references, like ${NAME} above, are replaced with the record's field values when the email is sent. Rather than typing in a reference, place your cursor where you want it and click the matching field name in the list on the right to insert it there.

    Add email subject
    Add email subject
  3. Enter the body. Clicking a field on the right inserts a reference at your cursor. The body accepts markdown:

    ## New patient registration
    
       **${NAME}**, age ${AGE}, was registered by ${_user.name}.
    
       Status: ${STATUS}
    
    Add email body
    Add email body
  4. Select Done to close the content editor and Done again to close the step.

    Complete the email step
    Complete the email step

Step 6: Save and test

  1. Select Save. The automation is now active.

    Save the email step
    Save the email step
  2. Add a test record to the Patient Registration form.

    Add a record
    Add a record
  3. Within moments, the coordinator receives an email containing the patient’s details, along with a View record button that is automatically added to the email alert. When clicked, the button opens the record directly in ActivityInfo.

    Email alert
    Email alert

Going further

  • Notify only for some registrations: add a filter step between the trigger and the email — for example AGE < 5 to notify only for under-five registrations.
  • Notify on status changes instead: use the On record edited trigger with the filter STATUS != _previous.STATUS, and include both values in the email: Status changed from ${_previous.STATUS} to ${STATUS}.
  • Send the registration to another system instead of (or in addition to) email: add a webhook step.
Next item
Send a message to Google Chat when a record is added