Class MailService

java.lang.Object
com.eurodyn.qlack.fuse.mailing.service.MailService

@Service @Validated public class MailService extends Object
Bean implementation for Send and Search Mail functionality
Author:
European Dynamics SA.
  • Constructor Details

  • Method Details

    • queueEmails

      public List<String> queueEmails(List<EmailDTO> dtos)
      Queue a list of Emails.
      Parameters:
      dtos - - list of email data transfer objects.
      Returns:
      List of email ids
    • queueEmail

      public String queueEmail(@Valid @Valid EmailDTO emailDto)
      Queue an email.
      Parameters:
      emailDto - - an email data transfer object.
      Returns:
      email id
    • cleanup

      public void cleanup(Long date, MailConstants.EMAIL_STATUS[] status)
      Removes all e-mails prior to the specified date having the requested status. Warning: If you pass a null date all emails irrespectively of date will be removed.
      Parameters:
      date - - the date before which all e-mails will be removed.
      status - - the status to be processed. Be cautious to not include e-mails of status QUEUED as such e-mails might not have been tried to be delivered yet.
    • deleteFromQueue

      public void deleteFromQueue(String emailId)
      Delete an email from the queue.
      Parameters:
      emailId - - the email id.
    • updateStatus

      public void updateStatus(String emailId, MailConstants.EMAIL_STATUS status)
      Update email status
      Parameters:
      emailId - the email Id
      status - the new email status
    • getMail

      public EmailDTO getMail(String emailId)
      Get an email DTO by Id
      Parameters:
      emailId - the email Id
      Returns:
      an email DTO object
    • getByStatus

      public List<EmailDTO> getByStatus(MailConstants.EMAIL_STATUS status)
      Get all email of the provided status
      Parameters:
      status - the provided status
      Returns:
      a list of email with the provided status
    • sendOne

      public void sendOne(String emailId)
      Send an email
      Parameters:
      emailId - the emailId
    • sendToDistributionList

      public void sendToDistributionList(String emailId, String distributionListId)
      Sends email to a mail distribution lists recipients.
      Parameters:
      emailId - the email to send.
      distributionListId - the mail distribution list.