Class TemplateEmailMessage

  • Direct Known Subclasses:
    DataProcessorTemplateEmailMessage

    public class TemplateEmailMessage
    extends Object
    This class allow to generate EmailMessage from templates.
    Since:
    3.1
    Author:
    Laurent Jourdren
    • Constructor Detail

      • TemplateEmailMessage

        public TemplateEmailMessage()
        Public constructor.
      • TemplateEmailMessage

        public TemplateEmailMessage​(Configuration conf)
        Public constructor.
        Parameters:
        conf - configuration
    • Method Detail

      • setHeader

        public void setHeader​(String header)
        Set the header of the message.
        Parameters:
        header - the footer of the message
      • setFooter

        public void setFooter​(String footer)
        Set the footer of the message.
        Parameters:
        footer - the footer of the message
      • setTemplate

        public void setTemplate​(String template)
        Set the template of the message.
        Parameters:
        template - the template of the message
      • setTemplateFromResource

        public void setTemplateFromResource​(String resource)
                                     throws IOException
        Set the template from a resource file.
        Parameters:
        resource - path of the resource file
        Throws:
        IOException - if an error occurs while reading the resource
      • setTemplateFromFile

        public void setTemplateFromFile​(Path templateFile)
                                 throws IOException
        Set the template from a resource file.
        Parameters:
        templateFile - path of the template file
        Throws:
        IOException - if an error occurs while reading the tenplate file
      • errorMessage

        public EmailMessage errorMessage​(Throwable t)
        Generate error EmailMessage object.
        Parameters:
        t - exception