Skip to content

Commit

Permalink
Merge pull request #30803 from gastaldi/attach
Browse files Browse the repository at this point in the history
Support file and byte array attachments in `MailTemplateInstance`
  • Loading branch information
gastaldi authored Feb 2, 2023
2 parents cd9c7d8 + 9c19b82 commit 3485b2e
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 3485b2e

Please sign in to comment.