com.ibm.commerce.emarketing.utils

Class EmailActivityUrlHelper

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


  • public class EmailActivityUrlHelper
    extends java.lang.Object
    A helper class to compose EmailOptOut and EmailEvent URLs.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      Copyright.
      static java.lang.String PARAMETER_ENCRYPTO
      The name of the URL query string parameter which is used to lookup the parameters encrypted on the URL.
    • Constructor Summary

      Constructors 
      Constructor and Description
      EmailActivityUrlHelper(java.lang.String encryptedString)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String composeClickedEventUrl(java.lang.String urlHeader, java.lang.Long usersId, java.lang.Integer emailPromotionId, java.lang.String nextUrl)
      Builds the URL which contains the PARAMETER_ENCRYPTO query string parameter which records when the user passed as usersId clicks on an item within the e-mail message generated from the e-mail promotion passed as emailPromotionId.
      static java.lang.String composeNormalUrl(java.lang.String urlHeader, java.lang.String nextUrl)
      Builds the URL which points to the specified nextUrl.
      static java.lang.String composeOpenedEventUrl(java.lang.String urlHeader, java.lang.Long usersId, java.lang.Integer emailPromotionId, java.lang.String nextUrl)
      Builds the URL which contains the PARAMETER_ENCRYPTO query string parameter which records when the user passed as usersId opens an e-mail message generated from the e-mail promotion passed as emailPromotionId.
      static java.lang.String composeOutOptUrl(java.lang.String urlHeader, java.lang.Long usersId, java.lang.Integer storeId, java.lang.Integer emailPromotionId, java.lang.String nextUrl)
      Builds the URL which contains the PARAMETER_ENCRYPTO query string parameter which allows a user to opt out of receiving e-mail from a store.
      static java.lang.String composeOutOptUrl(java.lang.String urlHeader, java.lang.Long usersId, java.lang.Integer storeId, java.lang.String nextUrl)
      Builds the URL which contains the PARAMETER_ENCRYPTO query string parameter which allows a user to opt out of receiving e-mail from a store.
      java.lang.Integer getEmailPromotionId()
      Gets the ID of the e-mail promotion that was placed in the original parameter string.
      java.lang.Integer getEventId()
      Gets the ID of the event type that was placed in the original parameter string.
      java.lang.String getNextUrl()
      Gets the redirect URL that was placed in the original parameter string.
      java.lang.Integer getStoreId()
      Gets the ID of the store that was placed in the original parameter string.
      java.lang.Long getUsersId()
      Gets the ID of the user that was placed in the original parameter string.
      • Methods inherited from class java.lang.Object

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

      • PARAMETER_ENCRYPTO

        public static final java.lang.String PARAMETER_ENCRYPTO
        The name of the URL query string parameter which is used to lookup the parameters encrypted on the URL. Use this value to identify the query string parameter and retrieve it's contents so that the original parameters may be restored.
        See Also:
        Constant Field Values
    • Constructor Detail

      • EmailActivityUrlHelper

        public EmailActivityUrlHelper(java.lang.String encryptedString)
        Constructor.
        Parameters:
        encryptedString - The encrypted string which contains the original parameter data.
    • Method Detail

      • composeClickedEventUrl

        public static java.lang.String composeClickedEventUrl(java.lang.String urlHeader,
                                                              java.lang.Long usersId,
                                                              java.lang.Integer emailPromotionId,
                                                              java.lang.String nextUrl)
        Builds the URL which contains the PARAMETER_ENCRYPTO query string parameter which records when the user passed as usersId clicks on an item within the e-mail message generated from the e-mail promotion passed as emailPromotionId. The PARAMETER_ENCRYPTO parameter is an encrypted string which contains query string parameters for each of the parameters pass to this method.
        Parameters:
        urlHeader - The URL path under which the EmailEventCmd command can be reached. For example, http://www.myhost.com/webapp/wcs/tools/servlet
        usersId - The ID of the user who receives the e-mail promotion.
        emailPromotionId - The ID of the e-mail promotion being sent.
        nextUrl - The URL to forward on to the browser after recording the click.
        Returns:
        The URL used to record the user clicking on an item within an e-mail message generated from and e-mail promotion.
      • composeNormalUrl

        public static java.lang.String composeNormalUrl(java.lang.String urlHeader,
                                                        java.lang.String nextUrl)
        Builds the URL which points to the specified nextUrl. This method is used, when the there is no need for recording the email events like clicked event and optOut event and opened event. This function returns the URL which just forwards to the specified URL without recording the event.
        Parameters:
        urlHeader - The URL path under which the next URL can be reached. For example, http://www.myhost.com/webapp/wcs/tools/servlet
        nextUrl - The URL to forward on to the browser.
        Returns:
        The complete URL path.
      • composeOpenedEventUrl

        public static java.lang.String composeOpenedEventUrl(java.lang.String urlHeader,
                                                             java.lang.Long usersId,
                                                             java.lang.Integer emailPromotionId,
                                                             java.lang.String nextUrl)
        Builds the URL which contains the PARAMETER_ENCRYPTO query string parameter which records when the user passed as usersId opens an e-mail message generated from the e-mail promotion passed as emailPromotionId. The PARAMETER_ENCRYPTO parameter is an encrypted string which contains query string parameters for each of the parameters pass to this method.
        Parameters:
        urlHeader - The URL path under which the EmailEventCmd command can be reached. For example, http://www.myhost.com/webapp/wcs/tools/servlet
        usersId - The ID of the user who receives the e-mail promotion.
        emailPromotionId - The ID of the e-mail promotion being sent.
        nextUrl - The URL to forward on to the browser after recording the open event.
        Returns:
        The URL used to record the user opening an e-mail message generated from and e-mail promotion.
      • composeOutOptUrl

        public static java.lang.String composeOutOptUrl(java.lang.String urlHeader,
                                                        java.lang.Long usersId,
                                                        java.lang.Integer storeId,
                                                        java.lang.Integer emailPromotionId,
                                                        java.lang.String nextUrl)
        Builds the URL which contains the PARAMETER_ENCRYPTO query string parameter which allows a user to opt out of receiving e-mail from a store. The PARAMETER_ENCRYPTO parameter is an encrypted string which contains query string parameters for each of the parameters pass to this method.
        Parameters:
        urlHeader - The URL path under which the EmailEventCmd command can be reached. For example, http://www.myhost.com/webapp/wcs/tools/servlet
        usersId - The ID of the user who receives the e-mail promotion.
        storeId - The ID the store which sent the e-mail promotion to the user.
        emailPromotionId - The ID the e-mail promotion that contained the link the user used to opt-out.
        nextUrl - The String representing the URL to which the user will be redirected after hitting the URL returned. Most likely, this will be a confirmation page.
        Returns:
        The URL which will allow the user to opt out of receiving e-mail from the given store.
      • composeOutOptUrl

        public static java.lang.String composeOutOptUrl(java.lang.String urlHeader,
                                                        java.lang.Long usersId,
                                                        java.lang.Integer storeId,
                                                        java.lang.String nextUrl)
        Builds the URL which contains the PARAMETER_ENCRYPTO query string parameter which allows a user to opt out of receiving e-mail from a store. The PARAMETER_ENCRYPTO parameter is an encrypted string which contains query string parameters for each of the parameters pass to this method.
        Parameters:
        urlHeader - The URL path under which the EmailEventCmd command can be reached. For example, http://www.myhost.com/webapp/wcs/tools/servlet
        usersId - The ID of the user who receives the e-mail promotion.
        storeId - The ID the store which sent the e-mail promotion to the user.
        nextUrl - The String representing the URL to which the user will be redirected after hitting the URL returned. Most likely, this will be a confirmation page.
        Returns:
        The URL which will allow the user to opt out of receiving e-mail from the given store.
      • getEmailPromotionId

        public java.lang.Integer getEmailPromotionId()
        Gets the ID of the e-mail promotion that was placed in the original parameter string.
        Returns:
        The ID of the e-mail promotion that was found within the original (decrypted) string.
      • getEventId

        public java.lang.Integer getEventId()
        Gets the ID of the event type that was placed in the original parameter string.
        Returns:
        The ID of the event type that was found within the original (decrypted) string.
      • getNextUrl

        public java.lang.String getNextUrl()
        Gets the redirect URL that was placed in the original parameter string.
        Returns:
        The redirect URL that was found within the original (decrypted) string.
      • getStoreId

        public java.lang.Integer getStoreId()
        Gets the ID of the store that was placed in the original parameter string.
        Returns:
        The ID of the store that was found within the original (decrypted) string.
      • getUsersId

        public java.lang.Long getUsersId()
        Gets the ID of the user that was placed in the original parameter string.
        Returns:
        The user's ID that was found within the original (decrypted) string.