com.ibm.commerce.emarketing.commands

Class SendEmailActivityTaskCmdImpl

  • java.lang.Object
    • com.ibm.websphere.command.CacheableCommandImpl
      • com.ibm.commerce.command.MeasuredCacheableCommandImpl
        • com.ibm.commerce.command.AbstractECTargetableCommand
          • com.ibm.commerce.command.TaskCommandImpl
            • com.ibm.commerce.emarketing.commands.SendEmailActivityTaskCmdImpl
  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, com.ibm.commerce.command.TaskCommand, SendEmailActivityTaskCmd, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class SendEmailActivityTaskCmdImpl
    extends com.ibm.commerce.command.TaskCommandImpl
    implements SendEmailActivityTaskCmd
    The TaskCommand implementation used to send e-mail activities that have been configured in WebSphere Commerce Accelerator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean getSentLastBatch()
      This method returns if the last batch of e-mail has been sent.
      void performExecute()
      Performs the operations required to deliver the e-mail activity set by the setEmailPromotionId method.

      Delivery is performed by the following steps:

      EmailPromotionAccessBean is used to lookup the e-mail activity configuration based on the value passed to setEmailPromotionId.
      void setDeleteMemberGroupAfterSend(boolean del)
      This method sets if the member group associated with the e-mail promotion should be deleted after the e-mails have been sent.
      void setEmailPromoMemberGroupId(java.lang.String mbrGrpId)
      This method sets the ID of the member group associated with the e-mail promotion.
      void setEmailPromotionId(java.lang.Integer newEmailPromotionId)
      Sets the unique identifier of the e-mail activity that is to be sent.
      void setMemberGroupIds(java.lang.String[] mbrGrpIds, java.lang.String anyOrAll)
      This method sets the additional member group IDs of the customer segment to which to send the the bulk email.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand

        accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
      • Methods inherited from interface com.ibm.commerce.command.CacheableECCommand

        execute
      • Methods inherited from interface com.ibm.commerce.command.ECCommand

        checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
    • Field Detail

    • Constructor Detail

      • SendEmailActivityTaskCmdImpl

        public SendEmailActivityTaskCmdImpl()
    • Method Detail

      • getSentLastBatch

        public boolean getSentLastBatch()
        This method returns if the last batch of e-mail has been sent. A scheduled job is created for each batch. This value will be true after the last scheduled job has run.
        Returns:
        Has the last batch of e-mail been sent.
      • performExecute

        public void performExecute()
                            throws com.ibm.commerce.exception.ECException
        Performs the operations required to deliver the e-mail activity set by the setEmailPromotionId method.

        Delivery is performed by the following steps:

        1. EmailPromotionAccessBean is used to lookup the e-mail activity configuration based on the value passed to setEmailPromotionId.
        2. The membergroupId within the EmailPromotionAccessBean is passed to ListEmailRecipientsInMemberGroupTaskCmd and executed.
        3. An EmailDistributor implementation is passed the listEmailRecipientsInMemberGroupTaskCmd as an EmailRecipientSupplier.
        4. A PersonalizedEmailContent object is created from the e-mail message template assigned to the e-mail activity and passed to the EmailDistributor implementation.
        5. The e-mail server information is looked up for the store and passed to the EmailDistributor implementation.
        6. The distribute method is called on the EmailDistributor implementation.
        7. The list of recipients returned from ListEmailRecipientsInMemberGroupTaskCmd is used to create a new EmailRecipientsAccessBean to record the recipient addresses passed to EmailDistributor (to whom distribution was attempted).

        Specified by:
        performExecute in interface com.ibm.commerce.command.ECCommand
        Overrides:
        performExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.ECException
        com.ibm.commerce.exception.ECException
      • setDeleteMemberGroupAfterSend

        public void setDeleteMemberGroupAfterSend(boolean del)
        This method sets if the member group associated with the e-mail promotion should be deleted after the e-mails have been sent.
        Parameters:
        del - Set to true if the member group should be deleted.
      • setEmailPromoMemberGroupId

        public void setEmailPromoMemberGroupId(java.lang.String mbrGrpId)
        This method sets the ID of the member group associated with the e-mail promotion.
        Parameters:
        mbrGrpId - The ID of the member group.
      • setEmailPromotionId

        public void setEmailPromotionId(java.lang.Integer newEmailPromotionId)
        Sets the unique identifier of the e-mail activity that is to be sent.
        Specified by:
        setEmailPromotionId in interface SendEmailActivityTaskCmd
        Parameters:
        newEmailPromotionId - the email Promotion Id
      • setMemberGroupIds

        public void setMemberGroupIds(java.lang.String[] mbrGrpIds,
                                      java.lang.String anyOrAll)
        This method sets the additional member group IDs of the customer segment to which to send the the bulk email. These IDs are in addition to the member group passed in through the request property parameter memberGroupId to this command.
        Specified by:
        setMemberGroupIds in interface SendEmailActivityTaskCmd
        Parameters:
        mbrGrpIds - The set of IDs of the member groups to which to send the bulk email.
        anyOrAll - Should the email be sent to the customers in each of the specified groups (any), or should the email be sent to those who are in all of the specified groups (all). Valid values are: any, all.