Package com.chatmotorapi.api.notify
Class EmailNotificationChannel.Builder
java.lang.Object
com.chatmotorapi.api.notify.EmailNotificationChannel.Builder
- Enclosing class:
- EmailNotificationChannel
public static class EmailNotificationChannel.Builder extends Object
Builder class for
EmailNotificationChannel.-
Constructor Summary
Constructors Constructor Description Builder() -
Method Summary
Modifier and Type Method Description EmailNotificationChannelbuild()Builds and returns anEmailNotificationChannelinstance based on the builder's settings.EmailNotificationChannel.BuilderchatMotor(ChatMotor chatMotor)Sets theChatMotorfor sending notifications.EmailNotificationChannel.BuilderfromAddress(String fromAddress)Sets the sender email address.EmailNotificationChannel.Builderlogger(org.slf4j.Logger logger)Sets theLoggerinstance for logging operations within the treatment process.EmailNotificationChannel.Buildermessage(String message)Sets the email message content.EmailNotificationChannel.BuildersmtpHost(String smtpHost)Sets the SMTP host used for sending emails.EmailNotificationChannel.BuildersmtpPassword(String smtpPassword)Sets the SMTP password for authentication.EmailNotificationChannel.BuildersmtpPort(int smtpPort)Sets the SMTP port used for sending emails.EmailNotificationChannel.BuildersmtpUsername(String smtpUsername)Sets the SMTP username for authentication.EmailNotificationChannel.Buildersubject(String subject)Sets the email subject.EmailNotificationChannel.BuildertoAddress(String toAddress)Sets the recipient email address.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
chatMotor
Sets theChatMotorfor sending notifications.- Parameters:
chatMotor- the ChatMotor instance to use for sending notifications- Returns:
- this builder for chaining
-
logger
Sets theLoggerinstance for logging operations within the treatment process. Default value isLoggerFactory.getLogger(Class)if not provided.- Parameters:
logger- the Logger to use- Returns:
- this builder for chaining
-
smtpHost
Sets the SMTP host used for sending emails.- Parameters:
smtpHost- the SMTP host- Returns:
- this builder for chaining
-
smtpPort
Sets the SMTP port used for sending emails.- Parameters:
smtpPort- the SMTP port- Returns:
- this builder for chaining
-
smtpUsername
Sets the SMTP username for authentication.- Parameters:
smtpUsername- the SMTP username- Returns:
- this builder for chaining
-
smtpPassword
Sets the SMTP password for authentication.- Parameters:
smtpPassword- the SMTP password- Returns:
- this builder for chaining
-
fromAddress
Sets the sender email address.- Parameters:
fromAddress- the sender email address- Returns:
- this builder for chaining
-
toAddress
Sets the recipient email address.- Parameters:
toAddress- the recipient email address- Returns:
- this builder for chaining
-
subject
Sets the email subject.- Parameters:
subject- the email subject- Returns:
- this builder for chaining
-
message
Sets the email message content.- Parameters:
message- the email message content- Returns:
- this builder for chaining
-
build
Builds and returns anEmailNotificationChannelinstance based on the builder's settings.- Returns:
- the configured EmailNotificationChannel instance
- Throws:
IllegalArgumentException- if any required fields are not set or are invalid
-