Giter VIP home page Giter VIP logo

email-generator's Introduction

Email Provider Service

Introduction

This is an application designed for adding capabilities to integrate with different email providers. Basic DDD and SOLID principles are applied in the design so that email providers can be easily added and removed.

Implementation

  • Spring boot 2.7.15
  • H2 as InMemory DB.

Requirements

  • Java 11
  • Maven
  • Lombok Support
  • Annotation Processor

Properties:

property sample value description
server.port 8080 server http port
spring.datasource.url jdbc:h2:mem:emaildb db url
spring.datasource.username sa db user name
spring.datasource.password db password

Run Instruction

  • mvn clean install
  • ./mvnw spring-boot:run or mvn spring-boot:run or java -jar target/application-0.0.1-SNAPSHOT.jar
  • Data can be viewed/queried through h2 console http://localhost:8080/h2-console/

API:

api/v1/email/generate/{type} - GET

api/v1/report/generate - POST

Postman

The documentation for all sever endpoints can be found in /src/main/resources/POSTMAN_COLLECTION.json file.

  • Import the json collection file in Postman client.
  • Invoke Generate Email API for generating email based on supplied type.
  • Invoke Generate Report API for loading mock json and persist to db asynchronously.

Swagger UI:

http://localhost:8080/swagger-ui/

Supported Email Providers:

  • SENDGRID
  • SPARK
  • MAILGUN
  • DEFAULT

Features:

  • Based on the provider type, a template will be built and an email will be generated.
  • Currently, integration is implemented with SendGrid provider.
  • Remaining providers act as a mock email provider but the generated email is distinguished based on the type.
  • A fallback mechanism is implemented if supplied provider is not found or not up and running.
  • Fallback will be based on Priority value, the highest up and running provider will be picked to generate an email.
  • Priority will be swapped from failing provider to the new provider based on priority comparison.
  • Report Generator to generate and persist mock data asynchronously.

email-generator's People

Contributors

adhikari-sakar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.