Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

The purpose of this feature is to demonstrate how applications can send email notification to selected people on certain events.

Scenario:

In WLMDP application, TimeEntries tab, users can select time entrise and submit them for management approval. Once these items are successfully submitted, the respective manager(s) receive an email notification stating that there are new times available in CRSD platform that requires their attention.

The email contains a link to the CRSD website and the name of the submitter.

Common component Notification Publisher:

We utilized Notification Publisher for sending the emails.

Steps for setting up the feature:

  1. Create your account at https://notification.canada.ca/

  2. Create a new service
    Note: A service can be a Live Service (it doesn't have a limit to send e-mail, use this as a production one) or Trial Service

  3. Create a new template
    Note: Once you create your template, it's important to save your template ID. You will use that in the body when you call this service

  4. Give access to your team members.
    Note: On a trial service, it's important to add your client in a safelist if they are not part of your team member list

  5. Create your API Key
    Note: As a standard, it will be important to save this api key in Azure KeyVault. You will use that in the body when you call this service
    Note2: In test, create your key as Team and safelist

image.png

Good To Know

  1. To test with Postman:

On Premise
POST https://wwwappstest.tc.gc.ca/Saf-Sec-Sur/2/NotificationPublisher/Notification

SCED
POST https://ncdnotificationpublisherapp01.azurewebsites.net/Notification

Header:

Body:
{
"EmailAddress": "your-email-address",
"TemplateId": "your template GUID from GCNotify",
"Reference": "",
"Personalisation": { "user": "your-name" , "utilisateur": "your-name"},
"ApiKey": "your gcnotify key"
}

NOTES:
You can find an example of TemplateID and API Key here:

Template ID: https://portal.azure.com/#@034gc.onmicrosoft.com/asset/Microsoft_Azure_KeyVault/Secret/https://ncdsafsecsurkv01.vault.azure.net/secrets/NotificationPublisherGCNotifyTemplateExample

GCNofity Key: https://portal.azure.com/#@034gc.onmicrosoft.com/asset/Microsoft_Azure_KeyVault/Secret/https://ncdsafsecsurkv01.vault.azure.net/secrets/NotificationPublisherGCNotifyExample

  1. To test locallyYou need to add values in your secrets.json

image.png

To find the info, please take a look on the pipeline library:
DEV > https://dev.azure.com/transport-canada/MAACE-Solution and Data Architecture Services/_library?itemType=VariableGroups&view=VariableGroupView&variableGroupId=255&path=NotificationPublisher-DEV

TEST > https://dev.azure.com/transport-canada/MAACE-Solution and Data Architecture Services/_library?itemType=VariableGroups&view=VariableGroupView&variableGroupId=256&path=NotificationPublisher-TEST

  • No labels