Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Current Notification Service API:

...

Overview:

...

Overview:

   Sunbird email notification service is built to send an email. Any other service can call this service to notify the user.AS of now email service is configured by installation,
but now we need to channel based email configuration.

Problem Statement:

   How to do the email configuration per tenant(channel) for different types of email (content review,publish )etc.

Proposed Solution:

     As per the existing api specification:  We will used data base to store the email template file. File will be store per tenant for different kind of email. System will always have one default email template for
each email type, in case some of the tenant haven't set the template , he will get email with predefined template.

Table structure :
Name of table : email_template

attributedescription
namename of the template and must be unique.(PK)
template complete email body
createdOn when it's created 
lastUpdatedOn
createdBy userId of template creator
lastUpdatedBy





Current Notification Service API:

    URI : "/v1/notification/email"
Request :
{
"params": { },
"request":{
"name": "Aarvin",
"subject": "NOTIFICATION MAIL SEND TESTING 001",
"body": "This the testing Notification mail body",
"actionUrl": "https://lh3.googleusercontent.com/Yh6ZlCb8dQIDIwAWbwd2jboFCyTqq8wc2xbLMs9ykYemOX3vjOTtT6Npfbk-jFkCciwY=w300",
"actionName": "Download Image",
"recipientEmails": [],
"recipientUserIds": ["e4d4f77c-7d5f-4436-a01e-1fe129af875a"],
"emailTemplateType":"rejectContent",
"tempPassword":"gvvucd637",
"userName":"Alpha"
}
}
existing templates:
1. contentFlaggedMailTemplate
2. acceptFlagMailTemplate
3. rejectFlagMailTemplate
4. publishContentMailTemplate
5. rejectContentMailTemplate
6. welcomeMailTemplate
7. unlistedPublishContentMailTemplate
8. emailtemplate(default)

"recipientSearchQuery":{
Schema for email template is :
"namefilters": "Amit" (Initial Addressing){
"subject": "NOTIFICATION MAIL SEND TESTING 001" (subject of the mail)
"bodyrootOrgId": "This the testing Notification mail body" (Body of mail)
",
"actionUrl": "https://lh3.googleusercontent.com/Yh6ZlCb8dQIDIwAWbwd2jboFCyTqq8wc2xbLMs9ykYemOX3vjOTtT6Npfbk-jFkCciwY=w300" (Link to the content)
"actionName": "Download Image" (display name for the content link)
"recipientEmails"organisations.role": [""]
"recipientUserIds": ["e4d4f77c-7d5f-4436-a01e-1fe129af875a"]
"emailTemplateType":"rejectContent" (template type)
"tempPassword":"gvvucd637" (password for welcome email) }
"userName":"Alpha" (username for welcome email)
"orgName": "Team Sunbird" (Name of the sender to be displayed after regards) }
"fromEmail" : "support-staging@open-sunbird.org" (support/from email id,configurable)
"orgImageUrl" : "org logo url" (configurable)

   Proposed Solution

           Now will store different types of email template as blob in cassandra, and based on the emailTemplateType value in request will fetch the corresponding template, }
}

existing templates:
if not
found then will use our default template 'emailtemplate' for notification.

    New Feature

 1. contentFlaggedMailTemplate
Need to send notification mail to all the reviewers of a channel.
Solution 1 : 2. acceptFlagMailTemplate
will add one new parameter to the existing notification api i.e
"notifyReviewers" : true/false3. rejectFlagMailTemplate
based on the notifyReviewers flag will fetch all reviewers of the given channel and will notify them instead of making two extra call from portal to fetch all reviewers 4. publishContentMailTemplate
and then notify them.
solution 2 :5. rejectContentMailTemplate
will write new api for notifying reviewers6. welcomeMailTemplate
endpoint : /v1/notify/reviewers7. unlistedPublishContentMailTemplate

...

8. emailtemplate(default)