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 Details

    • Builder

      public Builder()
  • Method Details

    • chatMotor

      public EmailNotificationChannel.Builder chatMotor​(ChatMotor chatMotor)
      Sets the ChatMotor for sending notifications.
      Parameters:
      chatMotor - the ChatMotor instance to use for sending notifications
      Returns:
      this builder for chaining
    • logger

      public EmailNotificationChannel.Builder logger​(org.slf4j.Logger logger)
      Sets the Logger instance for logging operations within the treatment process. Default value is LoggerFactory.getLogger(Class) if not provided.
      Parameters:
      logger - the Logger to use
      Returns:
      this builder for chaining
    • smtpHost

      public EmailNotificationChannel.Builder smtpHost​(String smtpHost)
      Sets the SMTP host used for sending emails.
      Parameters:
      smtpHost - the SMTP host
      Returns:
      this builder for chaining
    • smtpPort

      public EmailNotificationChannel.Builder smtpPort​(int smtpPort)
      Sets the SMTP port used for sending emails.
      Parameters:
      smtpPort - the SMTP port
      Returns:
      this builder for chaining
    • smtpUsername

      public EmailNotificationChannel.Builder smtpUsername​(String smtpUsername)
      Sets the SMTP username for authentication.
      Parameters:
      smtpUsername - the SMTP username
      Returns:
      this builder for chaining
    • smtpPassword

      public EmailNotificationChannel.Builder smtpPassword​(String smtpPassword)
      Sets the SMTP password for authentication.
      Parameters:
      smtpPassword - the SMTP password
      Returns:
      this builder for chaining
    • fromAddress

      public EmailNotificationChannel.Builder fromAddress​(String fromAddress)
      Sets the sender email address.
      Parameters:
      fromAddress - the sender email address
      Returns:
      this builder for chaining
    • toAddress

      public EmailNotificationChannel.Builder toAddress​(String toAddress)
      Sets the recipient email address.
      Parameters:
      toAddress - the recipient email address
      Returns:
      this builder for chaining
    • subject

      public EmailNotificationChannel.Builder subject​(String subject)
      Sets the email subject.
      Parameters:
      subject - the email subject
      Returns:
      this builder for chaining
    • message

      public EmailNotificationChannel.Builder message​(String message)
      Sets the email message content.
      Parameters:
      message - the email message content
      Returns:
      this builder for chaining
    • build

      public EmailNotificationChannel build()
      Builds and returns an EmailNotificationChannel instance based on the builder's settings.
      Returns:
      the configured EmailNotificationChannel instance
      Throws:
      IllegalArgumentException - if any required fields are not set or are invalid