Class MailServiceHelper

java.lang.Object
net.solarnetwork.central.mail.support.MailServiceHelper
All Implemented Interfaces:
Serializable

public class MailServiceHelper extends Object implements Serializable
Factory helper class for creating mail objects.
See Also:
  • Constructor Details

    • MailServiceHelper

      public MailServiceHelper()
  • Method Details

    • createAddress

      public MailAddress createAddress(String toName, String toAddress)
      Create a new MailAddress from a display name and an email address.
      Parameters:
      toName - the display name
      toAddress - the email address
      Returns:
      new MailAddress
    • createResourceDataSource

      public MessageTemplateDataSource createResourceDataSource(String subject, String resourcePath, Locale locale, Object... params)
      Create a new MessageTemplateDataSource from necessary components.
      Parameters:
      subject - the mail subject
      resourcePath - the resource path
      locale - the message locale
      params - the message template parameters
      Returns:
      new MessageTemplateDataSource