Skip to content

Commit

Permalink
Add the id parameter only when there is none.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanst-stoyanov committed Jun 30, 2017
1 parent 3a7a766 commit 85dedc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.storakle</groupId>
<artifactId>mailgun</artifactId>
<version>0.1.14</version>
<version>0.1.15</version>

<build>
<sourceDirectory>src/main/java</sourceDirectory>
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/storakle/mailgun/MailgunApiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ public List<SendMessageResponse> sendMessage(Message message, List<Recipient> re
// Prepare the recipient variables object.
ObjectNode recipientVariablesObject = objectMapper.createObjectNode();
recipient.getVariables().forEach((key, value) -> recipientVariablesObject.put(key, value));
recipientVariablesObject.put("id", i + 1);

if(!recipientVariablesObject.has("id"))
{
recipientVariablesObject.put("id", i + 1);
}

recipientEmails.add(recipient.getEmail());

Expand Down

0 comments on commit 85dedc8

Please sign in to comment.