Communication components

From Arawak
Jump to: navigation, search

The objective of this component is to offer microservices that guarantee communication with users and the community, in the version of the Arawak MVP, a microservice is provided for the sending of emails.

Email

Microservice for sending emails

Based on the fact that e-mail is widely adopted worldwide and that virtually everyone on the Internet has at least one mailbox, a microservice is provided to facilitates sending e-mails from the platform and that has a simple but flexible API so developers can send emails quickly.

The technologies of this microservice are Java programming language, Spring Boot development framework and the JavaMail library is used for the communication with SMTP mail servers. The microservice is offered configured with a pre-configured email account to simplify this process.

Main functionalities:

  • Send a simple email, based on a body of mail only text and free to specify.
  • Send an email using an HTML email template**.
 **For sending emails using HTML templates, the URL that is shared by HTTP must be provided in the information passed to the API the template that the microservice will use to send the email. The use of templates allows, for greater flexibility, the use of dictionaries. A dictionary is a group of keys => value where in the template the keys are placed using double keys (worth the redundancy), for example: $ {user_name} and for this must exist a key in the message that matchs with the corresponding value, for example: user_name => Jhon Doe. When sending the email all the content of $ {username_} by Jhon Doe will be replaced. See an example template in the Annex: Sample e-mail template.

The templates made by developers can be previously stored using the media management microservice.


All the available API of the microservice is documented using Swagger and is accessible by selecting /mail from the URL: http://api.opencaribbean.org