com.ibm.commerce.emarketing.engine

Class PersonalizedContentManagedEmailContent

  • java.lang.Object
    • com.ibm.commerce.emarketing.engine.PersonalizedContentManagedEmailContent
  • All Implemented Interfaces:
    EmailContent, PersonalizedEmailContent


    public class PersonalizedContentManagedEmailContent
    extends java.lang.Object
    implements PersonalizedEmailContent
    An implementation of PersonalizedEmailContent which uses the e-mail template to fetch the personalized e-mail message content. This class is intended for use when an e-mail template is to be the source of e-mail content.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      Copyright.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      com.ibm.commerce.command.CommandContext getCommandContext()
      Returns the CommandContext, used by the tag engine implementation for parsing the content of e-mail message.
      java.lang.String getContent()
      Gets the content of the e-mail message by parsing the content present in the emailContent table, corresponding to this e-mail template ID.
      java.lang.String getEmailTemplate()
      This method help to get the email template.
      java.lang.String getMessageId()
      Gets the messageId (email template Id) used to read e-mail content.
      Recipient getRecipient()
      Gets the recipient for whom the e-mail will be personalized.
      boolean getSendEmail()
      This method gets the setting whether the e-mail should be sent to the customer.
      java.lang.String getSubject()
      Gets the subject corresponding to this template ID.
      java.util.Map getTagNameValueMapFromTemplateParsing()
      This method help to get the name / value map for the tags in the content.
      void init()
      This method help to initialise the plain text for the message subject & message content, This method need only run once just after the email content object just been created, or do lazy initialisation.
      void setCommandContext(com.ibm.commerce.command.CommandContext cc)
      Sets the Command Context, which will be used by the TagEngine while parsing the e-mail content.
      void setMessageId(java.lang.String messageId)
      Sets the messageId that will be used to fetch the content of the e-mail.
      void setRecipient(Recipient recipient)
      Sets the recipient for whom the e-mail will be personalized.
      void setSendEmail(boolean newSendEmail)
      This method sets whether the e-mail should be sent to the customer.
      void setTagParameters(java.lang.String tagParamName, java.lang.String tagParamValue)
      Sets a name/value pair which will be added to the tag parameters, which will then be used while parsing the contents of e-mail template
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • PersonalizedContentManagedEmailContent

        public PersonalizedContentManagedEmailContent(Recipient recipient)
        Constructor that initializes this instance with a Recipient. Use this when multiple e-mails are to be sent to the same person.
        Parameters:
        recipient -
      • PersonalizedContentManagedEmailContent

        public PersonalizedContentManagedEmailContent(Recipient recipient,
                                                      java.lang.String messageId)
        Constructor that initializes this instance with a Recipient and a messageId.
        Parameters:
        recipient - the Recipient for whom the content will be personalized.
        messageId - the e-mail template ID to use for retrieving content of the e-mail.
      • PersonalizedContentManagedEmailContent

        public PersonalizedContentManagedEmailContent(java.lang.String messageId)
        Constructor that initializes this instance with an e-mail template ID ( messageId ). Use this to construct a PersonalizedEmailContent implementation which can be iteratively passed recipients to which the data from the same template (with different recipientId ) is to be sent.
        Parameters:
        messageId - The messageId (email template ID) to use when fetching e-mail content for the given recipient.
    • Method Detail

      • getCommandContext

        public com.ibm.commerce.command.CommandContext getCommandContext()
        Returns the CommandContext, used by the tag engine implementation for parsing the content of e-mail message.
        Returns:
        commandContext.
      • getContent

        public java.lang.String getContent()
        Gets the content of the e-mail message by parsing the content present in the emailContent table, corresponding to this e-mail template ID. This method uses the default TagEngineImpl class to parse the content and replace the tags with actual values.
        Specified by:
        getContent in interface EmailContent
        Returns:
        the content of the e-mail message
      • getEmailTemplate

        public java.lang.String getEmailTemplate()
        This method help to get the email template.
        Returns:
        the email template.
      • getMessageId

        public java.lang.String getMessageId()
        Gets the messageId (email template Id) used to read e-mail content.
        Returns:
        the messageId.
      • getSendEmail

        public boolean getSendEmail()
        This method gets the setting whether the e-mail should be sent to the customer. The e-mail should not be sent if a tag cannot generate the necessary content to put in the e-mail.
        Specified by:
        getSendEmail in interface PersonalizedEmailContent
        Returns:
        This method returns if the e-mail should be sent. The default setting for the class is true.
      • getSubject

        public java.lang.String getSubject()
        Gets the subject corresponding to this template ID. Fetches the subject from the emailContent table, corresponding to the e-mail Template ID (messageId).
        Specified by:
        getSubject in interface EmailContent
        Returns:
        The subject line.
      • getTagNameValueMapFromTemplateParsing

        public java.util.Map getTagNameValueMapFromTemplateParsing()
        This method help to get the name / value map for the tags in the content.
        Returns:
        the name / value map for the tags in the content.
      • init

        public void init()
        This method help to initialise the plain text for the message subject & message content, This method need only run once just after the email content object just been created, or do lazy initialisation.
      • setCommandContext

        public void setCommandContext(com.ibm.commerce.command.CommandContext cc)
        Sets the Command Context, which will be used by the TagEngine while parsing the e-mail content.
        Parameters:
        cc - CommandContext
      • setMessageId

        public void setMessageId(java.lang.String messageId)
        Sets the messageId that will be used to fetch the content of the e-mail.
        Parameters:
        messageId - the e-mail template ID to use.
      • setRecipient

        public void setRecipient(Recipient recipient)
        Sets the recipient for whom the e-mail will be personalized.
        Specified by:
        setRecipient in interface PersonalizedEmailContent
        Parameters:
        recipient - the Recipient.
      • setSendEmail

        public void setSendEmail(boolean newSendEmail)
        This method sets whether the e-mail should be sent to the customer. The e-mail should not be sent if a tag cannot generate the necessary content to put in the e-mail. If you do not want to send the partial e-mail to the customer, then call this method with a value of false. This method should be called by the getSubject or getContent methods.
        Parameters:
        newSendEmail - Set to false if the e-mail should not be sent.
      • setTagParameters

        public void setTagParameters(java.lang.String tagParamName,
                                     java.lang.String tagParamValue)
        Sets a name/value pair which will be added to the tag parameters, which will then be used while parsing the contents of e-mail template
        Parameters:
        tagParamName - the name of the name/value pair to add to the tag Parameters.
        tagParamValue - the value of the name/value pair to add to the tag Parameters.