Skip to content

Commit

Permalink
Support file and byte array attachments in MailTemplateInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Feb 2, 2023
1 parent fcb7e7b commit 9c19b82
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ interface MailTemplateInstance {

MailTemplateInstance addInlineAttachment(String name, File file, String contentType, String contentId);

MailTemplateInstance addInlineAttachment(String name, byte[] data, String contentType, String contentId);

MailTemplateInstance addAttachment(String name, File file, String contentType);

MailTemplateInstance addAttachment(String name, byte[] data, String contentType);

/**
*
* @param key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,24 @@ public MailTemplateInstance addInlineAttachment(String name, File file, String c
return this;
}

@Override
public MailTemplateInstance addInlineAttachment(String name, byte[] data, String contentType, String contentId) {
this.mail.addInlineAttachment(name, data, contentType, contentId);
return this;
}

@Override
public MailTemplateInstance addAttachment(String name, File file, String contentType) {
this.mail.addAttachment(name, file, contentType);
return this;
}

@Override
public MailTemplateInstance addAttachment(String name, byte[] data, String contentType) {
this.mail.addAttachment(name, data, contentType);
return this;
}

@Override
public MailTemplateInstance data(String key, Object value) {
this.templateInstance.data(key, value);
Expand Down

0 comments on commit 9c19b82

Please sign in to comment.