ed0906 / mjml4j

Java client for the MJML email builder API
Apache License 2.0
1 stars 2 forks source link

MJML4j

A MJML API client for Java.

You can use this library to communicate with the MJML REST Api and convert your pre-built MJML to a HTML email.

Support

This library currently supports V1 of the MJML API

Basic Use

Dependency
repositories {
    mavenCentral()
}

dependencies {
    compile 'io.camassia:mjml-client:1.0.0'
}
Create a client
MJMLClient client = MJMLClient.newDefaultClient()
                              .withApplicationID("...")
                              .withApplicationKey("...");

You can get an ApplicationID and APIKey from https://mjml.io/api

Render some MJML
    RenderRequest request = new RenderRequest("<mjml>...<mjml>");
    RenderResponse response = client.render(request);
    String mjml = response.getMJML();