public static final class EmailBuilder.EmailBuilderInstance extends Object
MailerBuilder
, but as an instance (so we can keep track of state). This is because
ignoringDefaults()
is the only method that doesn't return a EmailPopulatingBuilder
but returns to the inital API instead.
As with the EmailBuilder, every other method returns an EmailPopulatingBuilder
.
Modifier and Type | Method and Description |
---|---|
EmailPopulatingBuilder |
copying(Email email)
Preconfigures the builder with all the properties from the given email that are non-null.
|
EmailPopulatingBuilder |
copying(EmailPopulatingBuilder emailBuilder)
Delegates to
copying(Email) , by building the email first. |
EmailPopulatingBuilder |
copying(javax.mail.internet.MimeMessage message)
Delegates to
copying(Email) , by converting the email first. |
EmailPopulatingBuilder |
forwarding(Email email)
|
EmailPopulatingBuilder |
forwarding(javax.mail.internet.MimeMessage emailMessage)
Primes the email to build with proper subject and inline forwarded email needed for a valid RFC forward.
|
EmailPopulatingBuilder |
replyingTo(Email email)
Delegates to
replyingTo(MimeMessage, boolean, String) with replyToAll set to false and a default HTML quoting
template. |
EmailPopulatingBuilder |
replyingTo(Email email,
String customQuotingTemplate)
Delegates to
replyingTo(MimeMessage, boolean, String) with replyToAll set to false . |
EmailPopulatingBuilder |
replyingTo(javax.mail.internet.MimeMessage email)
Delegates to
replyingTo(MimeMessage, boolean, String) with replyToAll set to false and a default HTML quoting
template. |
EmailPopulatingBuilder |
replyingTo(javax.mail.internet.MimeMessage emailMessage,
boolean repyToAll,
String htmlTemplate)
Primes the email with all subject, headers, originally embedded images and recipients needed for a valid RFC reply.
|
EmailPopulatingBuilder |
replyingTo(javax.mail.internet.MimeMessage email,
String customQuotingTemplate)
Delegates to
replyingTo(MimeMessage, boolean, String) with replyToAll set to false . |
EmailPopulatingBuilder |
replyingToAll(Email email)
Delegates to
replyingTo(MimeMessage, boolean, String) with replyToAll set to true and a default HTML quoting
template. |
EmailPopulatingBuilder |
replyingToAll(Email email,
String customQuotingTemplate)
Delegates to
replyingTo(MimeMessage, boolean, String) with replyToAll set to true . |
EmailPopulatingBuilder |
replyingToAll(javax.mail.internet.MimeMessage email)
Delegates to
replyingTo(MimeMessage, boolean, String) with replyToAll set to true and a default HTML quoting
template. |
EmailPopulatingBuilder |
replyingToAll(javax.mail.internet.MimeMessage email,
String customQuotingTemplate)
Delegates to
replyingTo(MimeMessage, boolean, String) with replyToAll set to true . |
EmailPopulatingBuilder |
startingBlank()
Most common use case for creating a new email.
|
public EmailPopulatingBuilder startingBlank()
ignoringDefaults()
.
Note: Any builder method called after this will override the default value.
EmailBuilder.EmailBuilderInstance
to further populate the email with.public EmailPopulatingBuilder replyingTo(@Nonnull Email email)
replyingTo(MimeMessage, boolean, String)
with replyToAll set to false
and a default HTML quoting
template.public EmailPopulatingBuilder replyingToAll(@Nonnull Email email)
replyingTo(MimeMessage, boolean, String)
with replyToAll set to true
and a default HTML quoting
template.public EmailPopulatingBuilder replyingToAll(@Nonnull Email email, @Nonnull String customQuotingTemplate)
replyingTo(MimeMessage, boolean, String)
with replyToAll set to true
.DEFAULT_QUOTING_MARKUP
public EmailPopulatingBuilder replyingTo(@Nonnull Email email, @Nonnull String customQuotingTemplate)
replyingTo(MimeMessage, boolean, String)
with replyToAll set to false
.public EmailPopulatingBuilder replyingTo(@Nonnull javax.mail.internet.MimeMessage email)
replyingTo(MimeMessage, boolean, String)
with replyToAll set to false
and a default HTML quoting
template.public EmailPopulatingBuilder replyingToAll(@Nonnull javax.mail.internet.MimeMessage email, @Nonnull String customQuotingTemplate)
replyingTo(MimeMessage, boolean, String)
with replyToAll set to true
.DEFAULT_QUOTING_MARKUP
public EmailPopulatingBuilder replyingTo(@Nonnull javax.mail.internet.MimeMessage email, @Nonnull String customQuotingTemplate)
replyingTo(MimeMessage, boolean, String)
with replyToAll set to false
.public EmailPopulatingBuilder replyingToAll(@Nonnull javax.mail.internet.MimeMessage email)
replyingTo(MimeMessage, boolean, String)
with replyToAll set to true
and a default HTML quoting
template.DEFAULT_QUOTING_MARKUP
public EmailPopulatingBuilder replyingTo(@Nonnull javax.mail.internet.MimeMessage emailMessage, boolean repyToAll, @Nonnull String htmlTemplate)
Note: replaces subject with "Re: <original subject>" (but never nested).
Note: Make sure you set the content before using this API or else the quoted content is lost. Replaces body (text is
replaced with "> text" and HTML is replaced with the provided or default quoting markup.
emailMessage
- The message from which we harvest recipients, original content to quote (including embedded images), message ID to
include.repyToAll
- Indicates whether all original receivers should be included in this new reply. Also see MimeMessage.reply(boolean)
.htmlTemplate
- A valid HTML that contains the string "%s"
. Be advised that HTML is very limited in emails.replyingTo(Email)
,
replyingTo(Email, String)
,
replyingTo(MimeMessage)
,
replyingTo(MimeMessage, String)
,
replyingToAll(Email)
,
replyingToAll(Email, String)
,
replyingToAll(MimeMessage)
,
replyingToAll(MimeMessage, String)
,
Official JavaMail FAQ on replying,
MimeMessage.reply(boolean)
public EmailPopulatingBuilder forwarding(@Nonnull Email email)
EmailConverter.emailToMimeMessage(Email)
public EmailPopulatingBuilder forwarding(@Nonnull javax.mail.internet.MimeMessage emailMessage)
Note 1: replaces subject with "Fwd: <original subject>" (nesting enabled).
Note 2: Content-Disposition
will be left empty so the receiving email client can decide how to handle display
(most will show inline, some will show as attachment instead).
public EmailPopulatingBuilder copying(@Nonnull javax.mail.internet.MimeMessage message)
copying(Email)
, by converting the email first.public EmailPopulatingBuilder copying(@Nonnull EmailPopulatingBuilder emailBuilder)
copying(Email)
, by building the email first.EmailPopulatingBuilder.buildEmail()
public EmailPopulatingBuilder copying(@Nonnull Email email)
Copyright © 2018. All rights reserved.