Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

add MandrillImage and set to the MandrillMessage. #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.cribbstechnologies.clients.mandrill.model;

public class MandrillImage {

String type;
String name;
String content;

public MandrillImage(String type, String name, String content) {
this.type = type;
this.name = name;
this.content = content;
}

public String getContent() {
return this.content;
}

public String getName() {
return this.name;
}

public String getType() {
return this.type;
}

/**
* The attachment is represented by a base-64-encoded string
*
* @param content
*/
public void setContent(String content) {
this.content = content;
}

public void setName(String name) {
this.name = name;
}

public void setType(String type) {
this.type = type;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class MandrillMessage {
private List<MergeVar> global_merge_vars;
List<MessageMergeVars> merge_vars;
List<MandrillAttachment> attachments;
List<MandrillImage> images;
private boolean important;
private boolean auto_html;
private boolean inline_css;
Expand All @@ -37,6 +38,10 @@ public List<MandrillAttachment> getAttachments() {
return this.attachments;
}

public List<MandrillImage> getImages() {
return this.images;
}

public String getFrom_email() {
return this.from_email;
}
Expand Down Expand Up @@ -105,6 +110,10 @@ public void setAttachments(List<MandrillAttachment> attachments) {
this.attachments = attachments;
}

public void setImages(List<MandrillImage> images) {
this.images = images;
}

public void setAuto_text(boolean auto_text) {
this.auto_text = auto_text;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ public void testGetPostDataMandrillMessageRequest() throws Exception {
sb.append(",\"global_merge_vars\":null");
sb.append(",\"merge_vars\":null");
sb.append(",\"attachments\":null");
sb.append(",\"images\":null");
sb.append(",\"important\":false");
sb.append(",\"auto_html\":false");
sb.append(",\"inline_css\":false");
Expand Down Expand Up @@ -297,6 +298,7 @@ public void testGetPostDataMandrillMessageRequestWithBCC() throws Exception {
sb.append(",\"global_merge_vars\":null");
sb.append(",\"merge_vars\":null");
sb.append(",\"attachments\":null");
sb.append(",\"images\":null");
sb.append(",\"important\":false");
sb.append(",\"auto_html\":false");
sb.append(",\"inline_css\":false");
Expand Down