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 EmailNotificationChannel
build()
Builds and returns anEmailNotificationChannel
instance based on the builder's settings.EmailNotificationChannel.Builder
chatMotor(ChatMotor chatMotor)
Sets theChatMotor
for sending notifications.EmailNotificationChannel.Builder
fromAddress(String fromAddress)
Sets the sender email address.EmailNotificationChannel.Builder
logger(org.slf4j.Logger logger)
Sets theLogger
instance for logging operations within the treatment process.EmailNotificationChannel.Builder
message(String message)
Sets the email message content.EmailNotificationChannel.Builder
smtpHost(String smtpHost)
Sets the SMTP host used for sending emails.EmailNotificationChannel.Builder
smtpPassword(String smtpPassword)
Sets the SMTP password for authentication.EmailNotificationChannel.Builder
smtpPort(int smtpPort)
Sets the SMTP port used for sending emails.EmailNotificationChannel.Builder
smtpUsername(String smtpUsername)
Sets the SMTP username for authentication.EmailNotificationChannel.Builder
subject(String subject)
Sets the email subject.EmailNotificationChannel.Builder
toAddress(String toAddress)
Sets the recipient email address.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
chatMotor
Sets theChatMotor
for sending notifications.- Parameters:
chatMotor
- the ChatMotor instance to use for sending notifications- Returns:
- this builder for chaining
-
logger
Sets theLogger
instance 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 anEmailNotificationChannel
instance based on the builder's settings.- Returns:
- the configured EmailNotificationChannel instance
- Throws:
IllegalArgumentException
- if any required fields are not set or are invalid
-