Class EmailMapping.Builder
- java.lang.Object
-
- de.sebastianhesse.cdk.ses.email.forwarding.EmailMapping.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<EmailMapping>
- Enclosing interface:
- EmailMapping
@Stability(Stable) public static final class EmailMapping.Builder extends Object implements software.amazon.jsii.Builder<EmailMapping>
A builder forEmailMapping
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EmailMappingbuild()Builds the configured instance.EmailMapping.BuilderreceiveEmail(String receiveEmail)Sets the value ofEmailMapping.getReceiveEmail()EmailMapping.BuilderreceivePrefix(String receivePrefix)Sets the value ofEmailMapping.getReceivePrefix()EmailMapping.BuildertargetEmails(List<String> targetEmails)Sets the value ofEmailMapping.getTargetEmails()
-
-
-
Method Detail
-
targetEmails
@Stability(Stable) public EmailMapping.Builder targetEmails(List<String> targetEmails)
Sets the value ofEmailMapping.getTargetEmails()- Parameters:
targetEmails- A list of target email addresses that should receive the forwarded emails for the given email addresses matched by either `receiveEmail` or `receivePrefix`. This parameter is required. Make sure that you only specify email addresses that are verified by SES. Otherwise SES won't send them out.Example:
['foobar@gmail.com', 'foo+bar@gmail.com', 'whatever@example.org']- Returns:
this
-
receiveEmail
@Stability(Stable) public EmailMapping.Builder receiveEmail(String receiveEmail)
Sets the value ofEmailMapping.getReceiveEmail()- Parameters:
receiveEmail- You can define a string that is matching an email address, e.g. `hello@example.org`. If this property is defined, thereceivePrefixwill be ignored. You must define either this property orreceivePrefix, otherwise no emails will be forwarded.- Returns:
this
-
receivePrefix
@Stability(Stable) public EmailMapping.Builder receivePrefix(String receivePrefix)
Sets the value ofEmailMapping.getReceivePrefix()- Parameters:
receivePrefix- A short way to match a specific email addresses by only providing a prefix, e.g. `hello`. The prefix will be combined with the given domain name fromEmailForwardingRuleProps. If an email was sent to this specific email address, all emails matching this receiver will be forwarded to all email addresses defined in `targetEmails`. IfreceiveEmailproperty is defined as well, thenreceiveEmailis preferred. Hence, only define one of them.- Returns:
this
-
build
@Stability(Stable) public EmailMapping build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<EmailMapping>- Returns:
- a new instance of
EmailMapping - Throws:
NullPointerException- if any required attribute was not provided
-
-