Interface EmailEventContentGenerator

    • Method Detail

      • isValidEvent

        boolean isValidEvent​(String event,
                             Object data)
        Checks if an email should be generated for the event. Same class can be listening to several events.
        Parameters:
        event - Event to check
        data - Data the email will be generated for (this can also determine whether the email must be sent)
        Returns:
        true if the email must be sent, false if not.
      • getSubject

        String getSubject​(Object data,
                          String event)
        Returns the email subject for the event and data.
      • getBody

        String getBody​(Object data,
                       String event)
        Returns the email body for the event and data.
      • getContentType

        String getContentType()
        Returns the type of content of the email. Tipically "text/html; charset=utf-8" or "text/plain; charset=utf-8"
      • getPriority

        int getPriority()
        When there are several classes listening to the same event, the order the emails are sent is based on this value.
        See Also:
        preventsOthersExecution()
      • preventsOthersExecution

        boolean preventsOthersExecution()
        In case there are several classes listening to the same event, when this method returns true, other emails with lower priority that might exist, will not be sent.
      • isAsynchronous

        boolean isAsynchronous()
        Asynchronous emails are sent in a separate thread not waiting them to finish to continue the rest of the execution flow.
      • getAttachments

        List<File> getAttachments​(Object data,
                                  String event)
        Returns the list of files to be attached to the email. Return null for no attachments