Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dev.ditsche:mjml-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dev.ditsche:mjml-client

This is a client for sending mjml emails from a Spring Boot REST API. It makes use of Mustache for templating and is adaptable.

  • 2.0.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

Java mjml-client

This is a client for sending mjml emails from java applications :heart:.

It is extendable, as you can add custom mail providers and comes with a SMTP and Mailjet provider out of the box.

Installation

Add the dependency to your maven dependencies:

<dependency>
    <groupId>dev.ditsche</groupId>
    <artifactId>mjml-client</artifactId>
    <version>1.2.3</version>
</dependency>

Usage

Creating templates

Place your mjml-mail templates at resources/templates

Sending mails

To send a mail, adapt the following code snippet.

// Create a config
SMTPConfig config = new SMTPConfig();
config.setHost("smtp.example.com");
config.setPort(465);
config.setUsername("test@example.com");
config.setPassword("test123!");

MJMLConfig mjmlConfig = new MJMLConfig("appId", "appSecret", "from@example.com");

// Init mail provider
MailProvider mailProvider = new SMTPMailProvider(mjmlConfig, config);

// Build a mail
Mail mail = MailBuilder.create("Email Subject")
    .to(new MailAddress("test@test.com", "Test Name"))
    .params("url", "http://example.com")
    .params("name", "John Doe")
    .template("path/to/template.mjml");

// Send the mail
mailProvider.send(mail);

FAQs

Package last updated on 28 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc