com.ibm.commerce.emarketing.utils

Class EmailTemplateUtil

  • java.lang.Object
    • com.ibm.commerce.emarketing.utils.EmailTemplateUtil


  • public class EmailTemplateUtil
    extends java.lang.Object
    The EMailTemplateUtil class provides some utility methods that are used by e-mail templates.
    • Field Summary

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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String getCampaignName(java.lang.String emailPromoId)
      This method returns the campaign name for the Email activity
      static java.lang.String getCampaignParameterValues(java.lang.String emailPromotionId, java.lang.String linkName)
      This method returns the cm_cr parameter value which is going to send to Coremetrics This parameter will have the format of cm_cr=OS:CampaignName-_-EmailActivity-_-PromoEmail-_-EmailTemplate-_-LinkName
      static java.lang.String getCampaignParameterValues(java.lang.String emailPromotionId, java.lang.String linkName, boolean includeOS)
      This method returns the cm_cr parameter value which is going to send to Coremetrics This parameter will have the following format when the includeOS is true cm_cr=OS:CampaignName-_-EmailActivity-_-PromoEmail-_-EmailTemplate-_-LinkName and the following format if the includeOS flag is false cm_cr=CampaignName-_-1-_-PromoEmail-_-EmailTemplate-_-LinkName
      static java.lang.String getClientId(java.lang.Integer storeId)
      Gets the clientId for the store specified by the storeId
      static java.util.Vector getDisplayTypes(java.lang.String tagName)
      This method returns all the available display types for a given tag name.
      static java.lang.Integer getEmailMsgId(java.lang.String emailPromotionId)
      This method returns the email message id
      static java.lang.String getEmailPromoName(java.lang.String emailPromotionId)
      This method returns the emailPromo Name
      static java.lang.String getEmailTemplateName(java.lang.Integer messageId)
      This method returns the email template name
      static java.lang.String getEmailTemplateName(java.lang.String emailPromotionId)
      This method returns the email template name
      static java.lang.String[] getImageRequestURLForEMSpot(java.lang.String emailPromoId, java.lang.String emsName, com.ibm.commerce.command.CommandContext commandContext)
      Returns the image request url array which contain the image request url to coremetrics for all the links present in the EMarketingSpot
      static java.lang.String[] getImageRequestURLForEMSpot(java.lang.String emailPromoId, java.lang.String emsName, com.ibm.commerce.command.CommandContext commandContext, java.lang.String catalogId)
      Returns the image request url array which contain the image request url to coremetrics for all the links present in the EMarketingSpot
      static java.lang.String getImageRequestURLForLink(java.lang.String emailPromoId, java.lang.String linkName, com.ibm.commerce.command.CommandContext commandContext)
      Returns the image request url which contain the image request url to coremetrics for the link
      static java.util.ArrayList getLinkNamesForEMSpot(java.lang.String emsName, com.ibm.commerce.command.CommandContext commandContent)
      Returns the link names of the links present in the EMarketing Spot
      static java.util.ArrayList getLinkNamesForEMSpot(java.lang.String emsName, com.ibm.commerce.command.CommandContext commandContent, java.lang.String catalogId)
      Returns the link names of the links present in the EMarketing Spot
      static java.lang.String getMarketingParameterValues(java.lang.String emailPromotionId, java.lang.String linkName)
      This method returns the cm_mmc parameter value which is going to send to Coremetrics This parameter will have the format of cm_mmc=Email-_-WebsphereCommerce-_-PromoEmail-_-LinkName
      static java.lang.String[] getTemplateViewByStoreType()
      This method returns all template views
      • Methods inherited from class java.lang.Object

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

    • Constructor Detail

      • EmailTemplateUtil

        public EmailTemplateUtil()
    • Method Detail

      • getCampaignName

        public static java.lang.String getCampaignName(java.lang.String emailPromoId)
                                                throws java.lang.Exception
        This method returns the campaign name for the Email activity
        Parameters:
        emailPromoId - The email activity id of the Email Activity
        Returns:
        String - campaignName
        Throws:
        java.lang.Exception
      • getCampaignParameterValues

        public static java.lang.String getCampaignParameterValues(java.lang.String emailPromotionId,
                                                                  java.lang.String linkName)
                                                           throws java.lang.Exception
        This method returns the cm_cr parameter value which is going to send to Coremetrics This parameter will have the format of cm_cr=OS:CampaignName-_-EmailActivity-_-PromoEmail-_-EmailTemplate-_-LinkName
        Parameters:
        emailPromotionId - The email Activity Id
        linkName - The name of the link which will be appended as the last attribute for cm_cr parameter
        Returns:
        String - cm_cr parameter
        Throws:
        java.lang.Exception
      • getCampaignParameterValues

        public static java.lang.String getCampaignParameterValues(java.lang.String emailPromotionId,
                                                                  java.lang.String linkName,
                                                                  boolean includeOS)
                                                           throws java.lang.Exception
        This method returns the cm_cr parameter value which is going to send to Coremetrics This parameter will have the following format when the includeOS is true cm_cr=OS:CampaignName-_-EmailActivity-_-PromoEmail-_-EmailTemplate-_-LinkName and the following format if the includeOS flag is false cm_cr=CampaignName-_-1-_-PromoEmail-_-EmailTemplate-_-LinkName
        Parameters:
        emailPromotionId - The email Activity Id
        linkName - The name of the link which will be appended as the last attribute for cm_cr parameter
        includeOS - A boolean flag to check whether the 'OS:' parameter needs to be passed with the cm_cr parameter
        Returns:
        String - cm_cr parameter
        Throws:
        java.lang.Exception
      • getClientId

        public static java.lang.String getClientId(java.lang.Integer storeId)
        Gets the clientId for the store specified by the storeId
        Parameters:
        storeId - The storeId of the store for which the clientId is required
        Returns:
        The clientId
      • getDisplayTypes

        public static java.util.Vector getDisplayTypes(java.lang.String tagName)
        This method returns all the available display types for a given tag name. TAGDPLYREL table stores the relationship between the TAGCLASS and TAGDISPLAY tables. Given a tagName, this method returns all the tagDisplay names associated with that name.
        Parameters:
        tagName - - Name of the tag, for which display types is needed
        Returns:
        String[] - List of Display types corresponding to this tag,null if there are any exceptions
      • getEmailMsgId

        public static java.lang.Integer getEmailMsgId(java.lang.String emailPromotionId)
                                               throws java.lang.Exception
        This method returns the email message id
        Parameters:
        emailPromotionId - The email activity id of the Email Activity
        Returns:
        String - Message Id
        Throws:
        java.lang.Exception
      • getEmailPromoName

        public static java.lang.String getEmailPromoName(java.lang.String emailPromotionId)
                                                  throws java.lang.Exception
        This method returns the emailPromo Name
        Parameters:
        emailPromotionId - The email activity id of the Email Activity
        Returns:
        String - email promo name
        Throws:
        java.lang.Exception
      • getEmailTemplateName

        public static java.lang.String getEmailTemplateName(java.lang.Integer messageId)
                                                     throws java.lang.Exception
        This method returns the email template name
        Parameters:
        messageId - The email activity id of the Email Activity
        Returns:
        String - emailTemplateName
        Throws:
        java.lang.Exception
      • getEmailTemplateName

        public static java.lang.String getEmailTemplateName(java.lang.String emailPromotionId)
        This method returns the email template name
        Parameters:
        emailPromotionId - The email activity id of the Email Activity
        Returns:
        String - emailTemplateName
      • getImageRequestURLForEMSpot

        public static java.lang.String[] getImageRequestURLForEMSpot(java.lang.String emailPromoId,
                                                                     java.lang.String emsName,
                                                                     com.ibm.commerce.command.CommandContext commandContext)
                                                              throws java.lang.Exception
        Returns the image request url array which contain the image request url to coremetrics for all the links present in the EMarketingSpot
        Parameters:
        emailPromoId - The email activity Id
        emsName - The EMSpot name
        commandContext - The commandContext
        Returns:
        the String array containing the image request urls
        Throws:
        java.lang.Exception
      • getImageRequestURLForEMSpot

        public static java.lang.String[] getImageRequestURLForEMSpot(java.lang.String emailPromoId,
                                                                     java.lang.String emsName,
                                                                     com.ibm.commerce.command.CommandContext commandContext,
                                                                     java.lang.String catalogId)
                                                              throws java.lang.Exception
        Returns the image request url array which contain the image request url to coremetrics for all the links present in the EMarketingSpot
        Parameters:
        emailPromoId - The email activity Id
        emsName - The EMSpot name
        commandContext - The commandContext
        catalogId - The catalog identifier
        Returns:
        the String array containing the image request urls
        Throws:
        java.lang.Exception
      • getImageRequestURLForLink

        public static java.lang.String getImageRequestURLForLink(java.lang.String emailPromoId,
                                                                 java.lang.String linkName,
                                                                 com.ibm.commerce.command.CommandContext commandContext)
                                                          throws java.lang.Exception
        Returns the image request url which contain the image request url to coremetrics for the link
        Parameters:
        emailPromoId - The email activity Id
        linkName - The link name
        commandContext - The command context
        Returns:
        the String containing the image request url
        Throws:
        java.lang.Exception
      • getLinkNamesForEMSpot

        public static java.util.ArrayList getLinkNamesForEMSpot(java.lang.String emsName,
                                                                com.ibm.commerce.command.CommandContext commandContent)
                                                         throws java.lang.Exception
        Returns the link names of the links present in the EMarketing Spot
        Parameters:
        emsName - The name of the emarketing spot
        commandContent - The command context
        Returns:
        A List containing the link names
        Throws:
        java.lang.Exception
      • getLinkNamesForEMSpot

        public static java.util.ArrayList getLinkNamesForEMSpot(java.lang.String emsName,
                                                                com.ibm.commerce.command.CommandContext commandContent,
                                                                java.lang.String catalogId)
                                                         throws java.lang.Exception
        Returns the link names of the links present in the EMarketing Spot
        Parameters:
        emsName - The name of the emarketing spot
        commandContent - The command context
        catalogId - The catalog identifier
        Returns:
        A List containg the link names
        Throws:
        java.lang.Exception
      • getMarketingParameterValues

        public static java.lang.String getMarketingParameterValues(java.lang.String emailPromotionId,
                                                                   java.lang.String linkName)
                                                            throws java.lang.Exception
        This method returns the cm_mmc parameter value which is going to send to Coremetrics This parameter will have the format of cm_mmc=Email-_-WebsphereCommerce-_-PromoEmail-_-LinkName
        Parameters:
        emailPromotionId - The email Activity Id
        linkName - The name of the link which will be appended as the last attribute for cm_cr parameter
        Returns:
        String - cm_mmc parameter
        Throws:
        java.lang.Exception
      • getTemplateViewByStoreType

        public static java.lang.String[] getTemplateViewByStoreType()
        This method returns all template views
        Returns:
        All template views that are available