Giter Club home page Giter Club logo

module-email's Introduction

Maven Central Java Version Required Maven Build

Email and SMS Module

This DynamiaTools extension allow you to send email and SMS messages using JavaMail and AWS. This library install a ew DynamiaTools module called Email with CRUDs to set up emails and sms accounts, email templates and query sending logs

Modules

  • Core: Entities, Services and API implementation
    • JPA Entities:
      • EmailAccount
      • EmailTemplate
      • EmailAddress
      • SMSMessageLog
  • UI: Actions and views for user interface integration.

Installation

Add the following dependencies to project classpath

Maven

<dependency>
    <groupId>tools.dynamia.modules</groupId>
    <artifactId>tools.dynamia.modules.email</artifactId>
    <version>3.1.1</version>
</dependency>
<dependency>
    <groupId>tools.dynamia.modules</groupId>
    <artifactId>tools.dynamia.modules.email.ui</artifactId>
    <version>3.1.1</version>
</dependency>

Gradle

compile 'tools.dynamia.modules:tools.dynamia.modules.email:3.1.1'
compile 'tools.dynamia.modules:tools.dynamia.modules.email.ui:3.1.1'

Usage

Main services are EmailService to send EmailMessage and SMSService to send SMSMessage

@Service
class SomeService { //spring service

    @Autowired
    private EmailService emailService;

    @Autowired
    private SMSService smsService;

    public void sendNotification(Person person, String message) {

        var email = new EmailMessage(person.getEmail(), "Notification", message); 
        var sms = new SMSMessage(person.getMobileNumber(), message);

        //sending messages is async
        emailService.send(email); //return a Future
        smsService.send(sms); //return sms uuid

    }
}

EmailService and SMSService require at least one preferred EmailAccount created. These service will get the preferred account automatically. On the other hand, you can set up the EmailAccount in the EmailMessage and AWS Credentials in the SMSMessage directly.

If the EmailMessage has a EmailTemplate and this template has configured an SMS message, when you send the email the SMS will be sent too.

License

DynamiaTools Email is available under Apache 2 License

module-email's People

Contributors

marioserrano09 avatar

Stargazers

 avatar

Watchers

 avatar  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.