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
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
EmailActivityUrlHelper(java.lang.String encryptedString)
          Constructor.
 
Method Summary
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 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.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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
Copyright.
See Also:
Constant Field Values

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

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.

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.

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.

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.

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.

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.

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.