[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge pull request #36 from VitaliiBV/master
Browse files Browse the repository at this point in the history
add support for templates
  • Loading branch information
sargue committed Apr 3, 2021
2 parents 3663142 + 259e7de commit b9455fa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ apply plugin: "jacoco"

group 'net.sargue'
archivesBaseName = 'mailgun'
version '1.9.2'
version '1.10.0'

sourceCompatibility = 1.7

Expand Down
20 changes: 20 additions & 0 deletions src/main/java/net/sargue/mailgun/MailBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,26 @@ public MailBuilder content(Body body) {
return text(body.text()).html(body.html());
}

/**
* Sets the name of transactional email template to be sent.
*
* @param templateName the name of transactional email template
* @return this builder
*/
public MailBuilder template(String templateName) {
return param("template", templateName);
}

/**
* This method adds the param {@code h:X-Mailgun-Variables} to the Mailgun request.
*
* @param variables custom JSON data to be attached to the message.
* @return this builder
*/
public MailBuilder variables(String variables) {
return param("h:X-Mailgun-Variables", variables);
}

/**
* Convenience shortcut to {@code Body.builder(configuration)}
*
Expand Down

0 comments on commit b9455fa

Please sign in to comment.