Email Notification Doc
Email Notification Doc
Email Notification Doc
Scope :- This system notifies the patient as well as the practice about the patient’s
appointment confirmation.
Proposed Approach :-
List of contents :-
1. External application -
2. Attachment service -
3. Attachment’s database -
6. Topic (email_Topic) –
8. Twilio -
1. External application - There is external application having its own database sending their
users data in JSON form first to the attachment service for handling the attachment file it returns
back the response with attachment_ID. After getting response as success and Id this
attachment_ID will be taken from application to send with another JSON data to message priority
service.
2. Attachment service :– As users may also add Attachment’s data with their JSON making the
TOPIC heavy as it later gets produced/consumed for this we would make a dedicated service to
handle Attachments to keep our application lighter and optimized. Also, it will store attachment
data in binary form into its dedicated attachment database and return attachment’s ID to the
application again.
3. Message Priority service :- After getting attachment ID from attachment service again a
JSON post will be done in continuation with earlier attachment JSON including the
attachment_ID and message priority High/Low. This service will check for message priority
depending upon users request this will decide to which email producer it will send the user JSON
data.
4. Email producer service :- The low priority email producer will get the JSON data from
message priority service and send into the email.Topic(Low priority).
5. Email Topic :- This topic (Low priority) will store the JSON data sent by email producer
service temporarily later to be consumed by email consumer service(Low priority).
6. Email consumer service :- This consumer service will consume the low priority message
from email.Topic and later will sent to Twilio.
7. Twilio – After the JSON data is consumed by the Email consumer service the same consumer
will contain TWILIO message sending business Logic and will send to TWILIO external
Application to send email as notification.
After the email is delivered/failed/pending its response will be sent back to the consumer.
And stored into Database.
8. Notification log service :- The response(delivered/failed/pending) from the Twilio will be sent
to email consumer service and later to the notification log service from the email consumer with
REST post call.
9. Notification Database :- The response will be stored into this Database and will be later
Application will get the reponse from notification Database with Rest Get call.
10. Database - The response/status of the email to be delivered/failed/pending is to be stored into
this database for later to be consumed.
POST :-
{
“sourceId” : “S1”
"attachment" : " Blob ",
}
Returns response
“attachmentId” : “001”
{
“sourceId” : “S1”,
“messageId” : “01ac0cd8-3d69-45ad-943c-35e811d4647a ”,
“messagePriority” : “High/Low”,
“from” : “[email protected]” ,
“to” : “[email protected]”,
“subject” : “This is subject”,
“body” : “This is message body”,
“replyTo” : “[email protected]”,
"attachmentId" : "001"
}
URL: /sendemail
Method: Post
In the above url, The application will be sending email data to messagePriority service to
decide the message priority based on application requirement, later will be sent to producer again
depending upon the required priority (High/Low)
URL: localhost:8090/send/lowpriority
Method: Post
In the above url, The messagePriority service will be sending email data to low priority email
producer after being decided the message priority based on application requirement, later will be
sent to low priority email producer again depending upon the requirement i.e Low.
In the above url, The low emailProducer service will be sending email data to low priority
email topic to be later consumed by low priority email consumer service.
1.6 Contract for email.consumer service to attachment service :- email.consumer service will
make a rest Get call to attachment service after matching the attachment_ID got from Topic this will get
attachement file for the particular ID.
1.7 Contract for email.consumer service to external messaging service i.e TWILIO ( when
priority is low ) :-
After the JSON data is consumed by the Low priority Email consumer the same consumer will contain
TWILIO message sending business Logic and will send to TWILIO external Application to send email to
the client as notification. Steps to configure Twilio into the consumer.
After the email is delivered/failed/pending its response will be sent back to the consumer. And stored into
Database.
URL: localhost:8090/send/callback
Method: Post
In the above url, The callback response received from Twilio to email.consumer will then send
to notification.log .
Source_ID Message_ID Status Response_ID
S1 01ac0cd8-3d69-45ad- Pending RS-S1-1001
943c-35e811d4647a
Once the notification.log service receives the response from email.consumer it will store the data to
notificationDB by using post method.
URL: localhost:8090/{messageId}/notificationstatus
Method: Get
In the above url, The application will get callback from notification.log service.