Here's all you need to know to build the perfect system of Email Notifications for your web applications.

1. Introduction

OMNIA Platform enables you to send email notifications using the SMTP server configured in your Platform configuration.

Besides that, the Platform lets you take advantage of modeled Text Templates to compose your emails.

2. Using Email Notifications

To send email notifications in the context of your applications, OMNIA has an API endpoint available in the context of your application. This endpoint can be used in your behaviours for example.

How to send an email using OMNIA?

To send emails, you can define:

  • Who will receive the notification;
  • Subject;
  • Body (Email body is handled as HTML that is embeded in the global notification style used by the Platform.).

The Subject and Body can be composed using a given text or using a Text Template (see here how to use Text Templates).

Accelerator The accelerator “Send an e-mail using a Text Template” is available in After Save Behaviours. This accelerator helps you to easily compose a request to send an email using Text Templates. To render the Text Template, the accelerator will us the current Entity as input data to the Template.


var httpClient = _Context.CreateApplicationHttpClient();

var dto = this.ToDto();
var emailRequestData = new
{
    To = new [] { new { Address = this._assigned } },
    Subject = new { Template = "SubjectTemplate", TemplateData = dto },
    Body = new { Template = "BodyTemplate", TemplateData = dto }
};

var requestResult = await httpClient.PostAsync("Email", emailRequestData);

if (!requestResult.IsSuccessStatusCode)
    return new AfterSaveMessage("It was not possible to send the email notification.", AfterSaveMessageType.Warning);

3. Customize Platform Notifications

You can customize lists “Export as CSV” feature notifications. To do that, create a Text Template for the Subject and other to the Body.

You will be receiving the Link (as DownloadLink) in the Text Template Data parameters.

Note: Use this feature to send emails in a user language. Create a Text Template and use the Language Texts.

How to customize the Export CSV Notification subject?

  1. Create a new Text Template using the name: ExportCsvSuccessEmailSubject
  2. Change the Template with the desired text. Example: OMNIA Platform - Your download is ready

How to customize the Export CSV Notification body?

  1. Create a new Text Template using the name: ExportCsvSuccessEmailBody
  2. Change the Template with the desired text (HTML can be used).
  <p>The data export you have requested has been processed.</p>
  <p>Click the "Download" link below to download the generated file:</p>
  <a href=""><b>Download</b></a>