Interface EmailBuilderInt
- All Known Implementing Classes:
Email.EmailBuilder
public interface EmailBuilderInt
-
Method Summary
Modifier and TypeMethodDescriptionAdds an attachment using automatic content type detection.Adds a "BCC" (blind carbon copy) recipient.Adds a "CC" (carbon copy) recipient.Adds a custom header in<key>format.addReplyTo(String email) Adds a "Reply-To" address.Adds a tag to the aggregatedX-Tagsheader.Adds a "TO" recipient.voidsend()Builds and sends the email.Set a "FROM" sender.
-
Method Details
-
addTo
Adds a "TO" recipient.This method can be called multiple times to add multiple recipients.
- Parameters:
email- recipient email address- Returns:
- this builder instance for chaining
-
setFrom
Set a "FROM" sender.- Parameters:
email- sender email address- Returns:
- this builder instance for chaining
-
addCc
Adds a "CC" (carbon copy) recipient.CC recipients are visible to all other recipients.
This method can be called multiple times to add multiple carbon copies.
- Parameters:
email- CC email address- Returns:
- this builder instance for chaining
-
addBcc
Adds a "BCC" (blind carbon copy) recipient.BCC recipients are hidden from other recipients.
This method can be called multiple times to add multiple blind carbon copies.
- Parameters:
email- BCC email address- Returns:
- this builder instance for chaining
-
addReplyTo
Adds a "Reply-To" address.If multiple addresses are added, all will be included in the Reply-To header.
- Parameters:
email- reply-to email address- Returns:
- this builder instance for chaining
-
addAttach
Adds an attachment using automatic content type detection.- Parameters:
name- file name as it will appear in the emailfilePath- path to the file in test resources- Returns:
- this builder instance for chaining
-
addTags
Adds a tag to the aggregatedX-Tagsheader.Multiple calls will accumulate values into a single header:
X-Tags: tag1,tag2,tag3
- Parameters:
tag- tag value- Returns:
- this builder instance for chaining
-
addHeader
Adds a custom header in<key>format.Example:
addHeader("X-env", "qa") → X-env: qa- Parameters:
key- header keyvalue- header value- Returns:
- this builder instance for chaining
-
send
void send()Builds and sends the email.- Throws:
EmailHelperException- if sending fails
-