Class MailHandlerImpl

    • Constructor Detail

      • MailHandlerImpl

        public MailHandlerImpl()
    • Method Detail

      • applyTemplate

        public String applyTemplate​(ApplyMailTemplateParams params)
        Description copied from interface: MailHandler
        Applies the configured e-mail template. Variables in the form {name} are replaced. All profile field variables are supported (see ProfileFieldHandler#getProfileFieldVariables(BasicUser)), plus others, such as: subject, message, salutation, unsubscribe, applicationName, date, dateTime, day, month and year.
        Specified by:
        applyTemplate in interface MailHandler
      • createMailProcessingContext

        public MailProcessingContext createMailProcessingContext​(String toName,
                                                                 String toEmail,
                                                                 String subject,
                                                                 String body,
                                                                 ConfigurationAccessor configurationAccessor,
                                                                 FileInfo... attachments)
        Description copied from interface: MailHandler
        Returns the context for sending an e-mail with the given information.
        Specified by:
        createMailProcessingContext in interface MailHandler
        Parameters:
        toName - Name of the receiver.
        toEmail - Email of the receiver.
        subject - Subject of the e-mail
        body - Body of the e-mail
        configurationAccessor - The configuration accessor to get the from name/e-mail
        attachments - The e-mail attachments
      • send

        public void send​(BasicUser from,
                         BasicUser to,
                         MailContext context,
                         MailContentProducer producer,
                         FileInfo... attachments)
        Description copied from interface: MailHandler
        Creates a new e-mail pending to be sent by MailProcessingPollingTask.
        If context is FORWARD_INTERNAL_MESSAGE:
      • The "From name" of the message will be the name of the given from user
      • The "From address" of the message will be the one declared in the configuration of the given from user.
      • The "Reply-to address" of the message will be the address of the given from user.
      • If context is NEW_EMAIL_VALIDATION:
      • The "To address" will be the new email
Specified by:
send in interface MailHandler