Class EmailQueueServiceImpl

All Implemented Interfaces:
IEmailQueueService

public class EmailQueueServiceImpl extends CayenneService implements IEmailQueueService
Provides an email queue service implementation.
See Also:
  • Constructor Details

    • EmailQueueServiceImpl

      public EmailQueueServiceImpl()
  • Method Details

    • process

      public boolean process(EmailQueue emailQueueItem)
      Create an email and attempts to send the email.

      Note that this method contains database transactions.

      The method change the email queue status for the EmailQueue item to COMPLETE state after sent the email.

      Specified by:
      process in interface IEmailQueueService
      Parameters:
      emailQueueItem - the email queue item to send
      Returns:
      true if the email is sent successfully
      See Also:
    • cloneEmailQueue

      public EmailQueue cloneEmailQueue(Long emailQueueId)
      Clone an email queue item. This item status will be set to be Cloned.
      Specified by:
      cloneEmailQueue in interface IEmailQueueService
      Parameters:
      emailQueueId - the email queue id
      Returns:
      the cloned email queue
    • validateEmailQueueList

      public void validateEmailQueueList(List<EmailQueue> emailList)
      Validates that the emails do not reach the threshold (i.e. flooding an address) where the to, from & subject are the same. This validation will be done on the email queue items that need to be sent in the one call of Email Queue job processing.
      Specified by:
      validateEmailQueueList in interface IEmailQueueService
      Parameters:
      emailList - of email queue items to validate