/ms-email

Microservice for sending email messages

Primary LanguageJava

Email Microservice

This project consists of a backend asynchronous microservice for sending emails for multiple purposes, from email notifications, user account confirmation, etc.

Application

Stack

  • Java 17

Technologies

  • Spring Boot
  • JavaMail
  • JPA / Hibernate
  • Maven
  • RabbitMQ

Database

Features

  • The project has an endpoint for sending email messages from POST requests. This is a synchronous endpoint.
  • For sending asynchrnous messages, it is connected to a AMPQ messaging service, that queues messages for sending when the service is available.

How to run this project

# clone repository
git clone https://github.com/pauloerico/ms-email

Add the credentials for the Google SMTP server, RabbitMQ service and ElephantSQL databaseon the application.properties file and you are ready to go!

Endpoint

  • Send email
POST http://localhost:8080/sending-email

DTO

{
    "ownerRef": "referência",
    "emailFrom": "sender@email.com",
    "emailTo": "recipient@email.com",
    "subject": "Email subject",
    "text": "Email message here."
}

References

Based on Michelli Brito's project and video tutorials:

Other references:

Alternative SMTP servers: