Interface IEmailService

    • Method Detail

      • queueEmail

        EmailQueue queueEmail​(Portal portal,
                              Submission submission,
                              String from,
                              String to,
                              String subject,
                              String body,
                              String category)
        Create an email on the email queue

        Note that this method contains database transactions.

        Parameters:
        portal - the portal object
        submission - the submission (optional, will be used to resolve IEmailService at send time if set)
        from - from address
        to - to address
        subject - the email subject
        body - the email body
        category - the category of the email queue
        Returns:
        the resulting email queue entry
      • queueEmail

        EmailQueue queueEmail​(Portal portal,
                              Submission submission,
                              String from,
                              String to,
                              String subject,
                              String body,
                              String category,
                              Map<String,​byte[]> attachmentMap)
        Create an email on the email queue

        Note that this method contains database transactions.

        Parameters:
        portal - the portal object
        submission - the submission (optional, will be used to resolve IEmailService at send time if set)
        from - from address
        to - to address
        subject - the email subject
        body - the email body
        category - the category of the email queue
        attachmentMap - the map of attachments (optional)
        Returns:
        the resulting email queue entry
      • queueEmail

        EmailQueue queueEmail​(Portal portal,
                              Submission submission,
                              String from,
                              String to,
                              String replyTo,
                              String subject,
                              String body,
                              String category,
                              Map<String,​byte[]> attachmentMap)
        Create an email on the email queue

        Note that this method contains database transactions.

        Parameters:
        portal - the portal object
        submission - the submission (optional, will be used to resolve IEmailService at send time if set)
        from - from address
        to - to address
        replyTo - the reply to address
        subject - the email subject
        body - the email body
        category - the category of the email queue
        attachmentMap - the map of attachments (optional)
        Returns:
        the resulting email queue entry
        Since:
        4.3.4
      • queueEmail

        EmailQueue queueEmail​(Portal portal,
                              Submission submission,
                              String from,
                              String to,
                              String cc,
                              String replyTo,
                              String subject,
                              String body,
                              String category,
                              Map<String,​byte[]> attachmentMap)
        Create an email on the email queue. Note that this method contains database transactions.
        Parameters:
        portal - the portal object
        submission - the submission (optional, will be used to resolve IEmailService at send time if set)
        from - from address
        to - to address
        cc - cc address
        replyTo - the reply to address
        subject - the email subject
        body - the email body
        category - the category of the email queue
        attachmentMap - the map of attachments (optional)
        Returns:
        the resulting email queue entry
        Since:
        18.15.0
      • queueFormReceiptEmail

        boolean queueFormReceiptEmail​(Submission submission,
                                      String toAddress)
        Queue email for submission receipt to an address.
        Parameters:
        submission - a submission (required)
        toAddress - an email address to send (required)
        Returns:
        true if an email was queue, or false if not user email address was found
        Since:
        5.1.0
      • queueFormReceiptEmail

        boolean queueFormReceiptEmail​(Submission submission,
                                      String toAddress,
                                      String ccAddress)
        Queue email for submission receipt to an address.
        Parameters:
        submission - a submission (required)
        toAddress - an email address to send (required)
        ccAddress - email address to cc (optional)
        Returns:
        true if an email was queue, or false if not user email address was found
        Since:
        18.5.0
      • queueTemplatedMessageForPortal

        void queueTemplatedMessageForPortal​(String emailAddress,
                                            String subject,
                                            String messageContent,
                                            Map<String,​Object> model,
                                            Portal portal)
        Queue the templated email message for specified portal. The Portal Property "Email Template HTML" provides the email message body.

        Note that this method contains database transactions.

        Parameters:
        emailAddress - the email address to send the email to (required)
        subject - the email (required)
        messageContent - the inner email message content (required)
        model - the model to merge with the messageContent (required)
        portal - the portal which provides the "Email Template HTML" property (required)
      • queueAccountStatusNotification

        void queueAccountStatusNotification​(UserAccount userAccount,
                                            Portal portal)
        Create the account status notification on the email queue.

        Note that this method contains database transactions.

        Parameters:
        userAccount - the user account (required)
        portal - the user portal (required)
      • queueNewAccountNotification

        void queueNewAccountNotification​(UserAccount userAccount,
                                         Portal portal)
        Create new account notification on the email queue. Note that this method contains database transactions.

        Note that this method contains database transactions.

        Parameters:
        userAccount - the user account (required)
        portal - the user portal (required)
      • queuePromotionNotificationMessage

        void queuePromotionNotificationMessage​(String toAddress,
                                               String formName,
                                               String promotionLevelName,
                                               String clientName,
                                               String notes)
        Queue a promotion notification message to the to address

        Note that this method contains database transactions.

        Parameters:
        toAddress - email to address
        formName - email from address
        promotionLevelName - promotion level name
        clientName - a client name
        notes - some notes to be displayed in the message
      • queueSavedFormEmail

        void queueSavedFormEmail​(Submission submission,
                                 String formUrl,
                                 String toAddress)
        Queue email with a link to a saved submission to an anonymous user
        Parameters:
        submission - the saved form submission (required)
        formUrl - the return form link URL (required)
        toAddress - the email address to send to (required)
        Since:
        5.1.0
      • queueSavedFormEmail

        void queueSavedFormEmail​(Submission submission,
                                 String formUrl,
                                 String toAddress,
                                 String ccAddress)
        Queue email with a link to a saved submission to an anonymous user
        Parameters:
        submission - the saved form submission (required)
        formUrl - the return form link URL (required)
        toAddress - the email address to send to (required)
        ccAddress - email address to cc (optional)
        Since:
        18.5.0
      • queueSubmissionUpdateNotification

        void queueSubmissionUpdateNotification​(Submission submission,
                                               String emailSubject,
                                               String emailBody)
        Create the submission update notification on an email queue.

        Note that this method contains database transactions.

        Parameters:
        submission - a submission object
        emailSubject - email subject
        emailBody - email body
      • queueShareFormEmail

        void queueShareFormEmail​(Submission submission,
                                 String senderName,
                                 String emailAddresses,
                                 String emailBody)
        Queue an email notifying people with whom a saved form has been shared.

        Note that this method contains database transactions.

        Parameters:
        submission - the submission (required)
        senderName - the name of the person sharing the submission (optional)
        emailAddresses - the list of recipients (required)
        emailBody - the email body (optional)
      • renderDeploymentPropertyTemplate

        String renderDeploymentPropertyTemplate​(String templateName,
                                                Map model)
        Render the named Deployment Property template value with the model using the Velocity engine.
        Parameters:
        templateName - the template Deployment Property name
        model - the model to render
        Returns:
        the rendered template
      • sendEmailMessage

        void sendEmailMessage​(String subject,
                              String message,
                              String fromAddress,
                              String replyToAddress,
                              String toAddress,
                              String ccAddress,
                              String bccAddress,
                              Map<String,​byte[]> attachmentMap,
                              Submission submission)
        Send an email message.
        Parameters:
        subject - email subject
        message - email message body
        fromAddress - the from address
        replyToAddress - the reply to address
        toAddress - email to address
        ccAddress - email address to cc
        bccAddress - email address to bcc
        attachmentMap - attachments map
        submission - the submission to which the email relates (optional)
      • sendMessage

        void sendMessage​(String subject,
                         String message,
                         String from,
                         String toAddress,
                         boolean backgroundThread)
        Send an email message, optionally using a background thread.
        Parameters:
        subject - email subject
        message - email message body
        from - email from address
        toAddress - email to address
        backgroundThread - send the email using a background thread
      • sendMessage

        void sendMessage​(String subject,
                         String message,
                         String from,
                         String toAddress)
        Send an email message.
        Parameters:
        subject - email subject
        message - email message body
        from - email from address
        toAddress - email to address
      • sendMessage

        void sendMessage​(String subject,
                         String message,
                         String from,
                         String toAddress,
                         String ccAddress)
        Send an email message
        Parameters:
        subject - email subject
        message - email message body
        from - email from address
        toAddress - email to address
        ccAddress - email address to cc
      • sendMessage

        void sendMessage​(String subject,
                         String message,
                         String fromAddress,
                         String toAddress,
                         String ccAddress,
                         Map<String,​byte[]> attachmentMap)
        Send an email message.
        Parameters:
        subject - email subject
        message - email message body
        fromAddress - the from address
        toAddress - email to address
        ccAddress - email address to cc
        attachmentMap - attachments map
      • sendMessage

        void sendMessage​(String subject,
                         String message,
                         String fromAddress,
                         String replyToAddress,
                         String toAddress,
                         String ccAddress,
                         String bccAddress,
                         Map<String,​byte[]> attachmentMap)
        Send an email message.
        Parameters:
        subject - email subject
        message - email message body
        fromAddress - the from address
        replyToAddress - the reply to address
        toAddress - email to address
        ccAddress - email address to cc
        bccAddress - email address to bcc
        attachmentMap - attachments map
      • sendMessageWithSubmissionAttachments

        void sendMessageWithSubmissionAttachments​(String subject,
                                                  String message,
                                                  String fromAddress,
                                                  String toAddress,
                                                  Map<String,​DataDocument> deliveryAttachmentsMap)
        Send an email message with the provided submission delivery process attachments map.
        Parameters:
        subject - email subject (required)
        message - email message body (required)
        fromAddress - the from address
        toAddress - email to address (required)
        deliveryAttachmentsMap - submission delivery process attachments map (required)
      • queueOrSendFormConfirmationReceiptMessage

        @Deprecated
        boolean queueOrSendFormConfirmationReceiptMessage​(Submission submission,
                                                          String toAddress)
        This can be used to queue an email to the user containing the receipt. Note: This method will use the contact email address, then try the user's email address. If neither is available, no email will be queued.

        This method will either use the Email Queue if a PDF receipt attachment must be generated for the email, or will execute the send email function in a new background thread so user thread is not blocked sending the email.

        Parameters:
        submission - the submission (required)
        toAddress - the send to email address
        Returns:
        true if an email was queue, or false if not user email address was found
      • sendFormReceiptMessage

        void sendFormReceiptMessage​(Submission submission,
                                    String toAddress)
        Send a submission receipt to an address.
        Parameters:
        submission - a submission (required)
        toAddress - an email address to send (required)
      • sendFormConfirmationMessage

        void sendFormConfirmationMessage​(Submission submission,
                                         String toAddress)
        Send a submission confirmation email to an address, which does not include a PDF receipt
        Parameters:
        submission - a submission (required)
        toAddress - an email address to send (required)
      • sendSavedFormEmail

        void sendSavedFormEmail​(Submission submission,
                                String formUrl,
                                String toAddress)
        Send an email with a link to a saved submission to an anonymous user
        Parameters:
        submission - the saved form submission (required)
        formUrl - the return form link URL (required)
        toAddress - the email address to send to (required)
      • sendSavedFormEmail

        void sendSavedFormEmail​(Submission submission,
                                String formUrl,
                                String toAddress,
                                boolean backgroundThread)
        Send an email with a link to a saved submission to an anonymous user
        Parameters:
        submission - the saved form submission (required)
        formUrl - the return form link URL (required)
        toAddress - the email address to send to (required)
        backgroundThread - send email in background thread
      • sendLostPasswordMessage

        void sendLostPasswordMessage​(UserAccount userAccount,
                                     String loginURL,
                                     Portal portal)
        Reset a user's password and send the email to his/her email address. Note that this method contains database transactions.
        Parameters:
        userAccount - the user account object
        loginURL - the URL for the user to change the password
        portal - the portal which take the request
      • sendWelcomeUserMessage

        void sendWelcomeUserMessage​(UserAccount userAccount,
                                    Portal portal)
        Send a welcome message to the user. Note that a new temp password is generated for the user.
        Parameters:
        userAccount - the user account
        portal - the portal instance
        Since:
        19.11.0
      • sendWelcomeUserMessage

        void sendWelcomeUserMessage​(UserAccount userAccount,
                                    Portal portal,
                                    String tempPassword)
        Send a welcome message to the user
        Parameters:
        userAccount - the user account
        portal - the portal instance
        tempPassword - the user password
      • sendTaskNotification

        boolean sendTaskNotification​(Submission submission)
        Send a task notification to a user or a group of users.
        Parameters:
        submission - the task submission (required)
        Returns:
        true if at least one addressee was found.
      • sendEmailVerification

        void sendEmailVerification​(Submission submission)
        Immediately send an submission verification email.
        Parameters:
        submission - the submission (required)
      • sendEmailVerification

        void sendEmailVerification​(String loginName,
                                   String emailAddress,
                                   String givenName,
                                   String familyName,
                                   String userKey,
                                   Portal portal)
        Immediately send an email verification email for a new user.
        Parameters:
        loginName - the user's login name (required)
        emailAddress - the user's email address (required)
        givenName - the user's given name (required)
        familyName - the user's family name (required)
        userKey - the user's user key (required)
        portal - the user portal (required)
      • sendDuplicatePaymentAlertEmailToClientAdmin

        String sendDuplicatePaymentAlertEmailToClientAdmin​(PaymentLog paymentLog)
        Send a duplicate payment alert email related to a payment log entry and return the sent email body message.
        Parameters:
        paymentLog - the paymentLog to generate the context for (required)
        Returns:
        the sent email body message
      • sendFraudAlertEmailToClientAdmin

        String sendFraudAlertEmailToClientAdmin​(PaymentLog paymentLog)
        Send a fraud alert email related to a payment log entry and return the sent email body message.
        Parameters:
        paymentLog - the paymentLog to generate the context for (required)
        Returns:
        the sent email body message
      • getTemplatedEmailMessageForSubmission

        String getTemplatedEmailMessageForSubmission​(Submission submission,
                                                     String subject,
                                                     String message)
        Return the HTML border templated email message for the given submission.
        Parameters:
        submission - the form submission
        subject - the email subject line
        message - the email message content
        Returns:
        HTML border templated email message
      • getTemplatedEmailMessageForSubmission

        String getTemplatedEmailMessageForSubmission​(Submission submission,
                                                     String subject,
                                                     String message,
                                                     Portal portal)
        Return the HTML border templated email message for the given submission.
        Parameters:
        submission - the form submission
        subject - the email subject line
        message - the email message content
        portal - the portal used to loookup the portal properties
        Returns:
        HTML border templated email message
      • getTemplatedEmailMessageForPortal

        String getTemplatedEmailMessageForPortal​(Portal portal,
                                                 String subject,
                                                 String message)
        Return the HTML border templated email message for the given submission.
        Parameters:
        portal - the portal object
        subject - the email subject line
        message - the email message content
        Returns:
        HTML border templated email message
      • sendTemplatedMessageForPortal

        void sendTemplatedMessageForPortal​(String emailAddress,
                                           String subject,
                                           String messageContent,
                                           Map<String,​Object> model,
                                           Portal portal)
        Send the templated email message for specified portal. The Portal Property "Email Template HTML" provides the email message body.
        Parameters:
        emailAddress - the email address to send the email to (required)
        subject - the email (required)
        messageContent - the inner email message content (required)
        model - the model to merge with the messageContent (required)
        portal - the portal which provides the "Email Template HTML" property (required)