Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Dac Thach Nguyen
Jul 31, 2018
  2900
(5 votes)

Language Manager: Receive email notification when import translation package success

When import a translation package using Language add-on, the project owner will be notified after the package is proccessed. The notification will be display on the bell which is on top of edit view. That required you to login into the system to know. The add-on allowed you to write your own notification provider which send notification in other channels.

In order to write custom provider you need to implement INotificationProvider which has method and property as below:

DisplayName: Name of the provider, example "Email Notification"
SetNotification: Method will be called after the import proccess has been finished.

After implement that interface, your notification provider will be display in config page of the add-on. See the image:Image language.png

Here is simple on I have implement, after config it in the admin page. You should receive email whenever a translation project imported.

public class EmailNotification : INotificationProvider
{
    public string DisplayName => "Email Notification";

    public void SetNotification(string userName, string message)
    {

        var mail = new MailMessage();
        mail.Subject = "Project has been translated successfully";
        mail.Body = message;

        mail.From = new MailAddress("<your email>@gmail.com");
        mail.To.Add(new MailAddress("<your email>@gmail.com"));

        var smtpClient = new SmtpClient();
        smtpClient.Send(mail);
    }
}
Jul 31, 2018

Comments

Please login to comment.
Latest blogs
Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog