Skip to content

Action: Send Mail

The send mail action emails users when they enter a workflow step. Mail subject and body can be fully customized and allow the use of various dynamic variables. This action can be used for notifications, reminders, and warnings before subsequent lifecycle actions are executed.

Dynamic variables

This action allows you to use various dynamic variables in both the subject and body of the email. These variables will be automatically replaced with the corresponding information when the email is sent. All variables must always be enclosed in double curly braces ({{ and }}) to be recognized as placeholders.

The following variables are available:

User information

  • {{user.id}} – User's numeric ID
  • {{user.username}} – Username
  • {{user.firstname}} – First name
  • {{user.lastname}} – Last name
  • {{user.email}} – Email address
  • {{user.idnumber}} – User's ID number
  • {{user.institution}} – Institution
  • {{user.timecreated}} – Account creation date and time
  • {{user.lastaccess}} – Last access date and time
  • {{user.lastaccessrelative}} – Relative time since last access
  • {{user.lastip}} – Last IP address
  • {{user.city}} – City
  • {{user.country}} – Country code

Moodle site information

  • {{site.name}} – Site full name
  • {{site.shortname}} – Site short name
  • {{site.supportemail}} – Site support email address

URLs to various relevant pages on the Moodle site

  • {{urls.home}} – Site base URL
  • {{urls.login}} – Login page URL
  • {{urls.profile}} – Target user profile URL
  • {{urls.support}} – Contact site support URL

Settings

Subject

Defines the email subject line. You can use plain text and placeholders for dynamic variables (see above).

Message

Defines the email body. You can use rich text (Moodle editor) and placeholders for dynamic variables (see above).

If invalid placeholders for dynamic variables are used, an error message will be displayed that lists all the unresolved placeholders. You can then adjust your text accordingly before saving.

Example

Example screenshot of the instance settings for the send mail action