mirror of
https://github.com/google/nomulus
synced 2026-01-08 23:23:32 +00:00
Add a disposition header to email attachments (#2223)
This may help with the billing-team with attached invoices. This is a standard header that should do no harm.
This commit is contained in:
@@ -138,6 +138,7 @@ public final class GmailClient {
|
||||
BodyPart attachmentPart = new MimeBodyPart();
|
||||
attachmentPart.setContent(attachment.content(), attachment.contentType().toString());
|
||||
attachmentPart.setFileName(attachment.filename());
|
||||
attachmentPart.setDisposition(MimeBodyPart.ATTACHMENT);
|
||||
multipart.addBodyPart(attachmentPart);
|
||||
}
|
||||
msg.addRecipients(RecipientType.BCC, toArray(emailMessage.bccs(), Address.class));
|
||||
|
||||
@@ -138,6 +138,7 @@ public class GmailClientTest {
|
||||
assertThat(attachment.getContentType()).startsWith(CSV_UTF_8.toString());
|
||||
assertThat(attachment.getContentType()).endsWith("name=filename");
|
||||
assertThat(attachment.getContent()).isEqualTo("foo,bar\nbaz,qux");
|
||||
assertThat(attachment.getDisposition()).isEqualTo("attachment");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user