Try our conversational search powered by Generative AI!

Dac Thach Nguyen
Jul 31, 2018
  2933
(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
Optimizely Search and Navigation - Part 2 - Filter Tips

Introduction Continuing from Part 1 – Search Tips , today I will share the next part – filter tips. The platform versions used for this article are...

Binh Nguyen Thi | Jul 1, 2024

Integrating HubSpot CRM without the MA Connector

Have HubSpot CRM? Want to push user data into it from Optimizely? Don’t have any personalisation requirements with that data? Don’t want to pay $80...

Matt Pallatt | Jun 27, 2024

Keeping the website secure by updating external packages

Did you see the latest warning from Optimizely to update this package with a critical security warning? https://world.optimizely.com/documentation/...

Daniel Ovaska | Jun 27, 2024

Optimizely CMS image anonymization now available for Linux!

The famous image anonymization add-on for Optimizely CMS, with at least 5 downloads, is now finally available for use on Linux. Supports simultaneo...

Tomas Hensrud Gulla | Jun 25, 2024 | Syndicated blog

Remove a segment from the URL in CMS 12

Problem : I have created thousands of pages dynamically using schedule jobs with different templates (e.g. one column, two columns, etc..) and stor...

Sanjay Kumar | Jun 21, 2024

Copying property values part 2

After publishing my last article about copying property values to other language versions, I received constructive feedback on how could I change t...

Grzegorz Wiecheć | Jun 18, 2024 | Syndicated blog