Interface PreSendMessageManipulator


  • public interface PreSendMessageManipulator

    This interface is an extension point to manipulate the message before being sent. It is allowed to cancel or postpone sending the message with a permanent or temporary messaging exception

    Since:
    10.0.42
    • Method Detail

      • preSendMessage

        void preSendMessage​(javax.mail.Message preSendMessage,
                            PreSendMessageInfo preSendMessageInfo,
                            OutgoingMessageInfo outgoingMessageInfo,
                            AnswerType answerType,
                            java.util.Optional<Ticket> ticket)
                     throws PermanentMessagingException,
                            TemporaryMessagingException
        The method is called before sending the message. Header and content of the message may by manipulated.
        Parameters:
        preSendMessage - The message to be sent. This message may be manipulated e.g. by adding X-Header or change of subject etc.
        preSendMessageInfo - The preSendMessageInfo object provides additional information about the PreSendMessage object.
        outgoingMessageInfo - The outgoingMessageInfo object provides additional information about the message on the outgoing queue waiting to be sent.
        answerType - The AnswerType of the message specifies the type of operation. In most cases the AnswerType.DEFAULT indicates the sending of the final answer of a ticket. There are also other types of answer operations e.g. intermediate reply or confirmation messages, so the implementor always has to decide which type of answer operation should be relevant according to the requirement.
        ticket - The ticket associated with the message - please note that the ticket is optional. The ticket may be unavailable e.g. for the AnswerType.NOTIFICATION if no ticket is associated with the message.
        Throws:
        PermanentMessagingException - Throw a PermanentMessagingException to indicate a permanent error. The message will be marked as send failure on the outgoing folder.
        TemporaryMessagingException - Throw a TemporaryMessagingException to indicate a temporary error. The message will stay on the outgoing folder to be sent again after a short period of time.
        Since:
        10.0.42