You can send email notifications to your users from anywhere in your application.
Emails use a JSON template for content - no need to wrestle with HTML tables. The JSON is then injected into an email template located in the /emails directory.
You can also use a custom HTML template by passing the name of the file as a custom value.
Sending Notifications to Yourself
If you wish to send a notification to yourself, you can use the mail utility endpoint:
1
POST/api/utility/mail
2
​
3
// accepts
4
{
5
name:'from-name',
6
email:'from-email-address',
7
message:'message body'
8
}
Copied!
This will send an email to the address stored in SUPPORT_EMAIL environment variable. You can see an example of this in the /help view.
Using Other Mail Providers
The mailing logic is isolated in model/mail with a raw API call, so if you'd like to use a provider other than Mailgun, you can simply update this API call in one location.