public class ListEmailRecipientsInMemberGroupTaskCmdImpl extends TaskCommandImpl implements ListEmailRecipientsInMemberGroupTaskCmd
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
Copyright.
|
Constructor and Description |
---|
ListEmailRecipientsInMemberGroupTaskCmdImpl() |
Modifier and Type | Method and Description |
---|---|
java.util.List | getEmailRecipients()
Returns a list of EmailRecipient objects created from the customer segment.
|
java.lang.String | getQuery()
Returns the SQL query used to generate the list of members in the group.
|
protected java.lang.String | getQueryToFindMemberIdAndEmailForIndividualUser(java.lang.Integer storeId, java.lang.Long userId)
This method is called in a dialog activity when sending an e-mail to an individual customer.
|
boolean | isReadyToCallExecute()
Checks if this command is ready to execute.
|
void | performExecute()
Runs this command.
|
void | setMemberGroupId(java.lang.Long memberGroupId)
Sets the member group ID of the customer profile from which to create EmailRecipient objects.
|
void | setMemberGroupIds(java.lang.String[] mbrGrpIds, java.lang.String anyOrAll)
This method sets the additonal member group IDs of the customer segment to which to send the the bulk email.
|
void | setQueryOnly(boolean flag)
Defers executing the query generated for querying members of the group to the caller.
|
void | setStoreEntityId(java.lang.Integer storeId)
Sets the store entity ID.
|
void | setUserId(java.lang.Long userId)
Sets the user ID.
|
public static final java.lang.String COPYRIGHT
public ListEmailRecipientsInMemberGroupTaskCmdImpl()
public void performExecute() throws ECException
public void setMemberGroupId(java.lang.Long memberGroupId)
public java.util.List getEmailRecipients()
public void setQueryOnly(boolean flag)
public java.lang.String getQuery()
public boolean isReadyToCallExecute()
public void setStoreEntityId(java.lang.Integer storeId)
public void setUserId(java.lang.Long userId)
protected java.lang.String getQueryToFindMemberIdAndEmailForIndividualUser(java.lang.Integer storeId, java.lang.Long userId)
"SELECT MEMBER_ID, EMAIL1, EMAIL2 FROM ADDRESS WHERE MEMBER_ID = " + userId + " AND MEMBER_ID = any (SELECT USERS_ID FROM EMLUSRRECV WHERE USERS_ID = " + userId + " AND ((RECEIVEEML = 1 AND STOREENT_ID = " + storeId + ") or (RECEIVEEML = 1 AND STOREENT_ID = 0)) and USERS_ID NOT IN (SELECT USERS_ID FROM EMLUSRRECV WHERE USERS_ID = " + userId + " AND RECEIVEEML = 0 AND STOREENT_ID = " + storeId + ")) AND SELFADDRESS = 1 AND STATUS = 'P'"A customization may want to have different behavior. For example, you may want to allow sending e-mail to a guest shopper who has filled in their address during checkout. The following example shows an SQL that could be used in that scenario:
"SELECT MEMBER_ID, EMAIL1, EMAIL2 FROM USERS, ADDRESS WHERE USERS.USERS_ID = " + userId + " AND USERS.USERS_ID = ADDRESS.MEMBER_ID AND ( (USERS.REGISTERTYPE = 'G' AND ADDRESS.STATUS = 'P') OR (USERS.REGISTERTYPE = 'R' AND ADDRESS.MEMBER_ID = any (SELECT USERS_ID FROM EMLUSRRECV WHERE USERS_ID = " + userId + " AND ((RECEIVEEML = 1 AND STOREENT_ID = " + storeId + ") or (RECEIVEEML = 1 AND STOREENT_ID = 0)) and USERS_ID NOT IN (SELECT USERS_ID FROM EMLUSRRECV WHERE USERS_ID = " + userId + " AND RECEIVEEML = 0 AND STOREENT_ID = " + storeId + ")) AND SELFADDRESS = 1 AND STATUS = 'P') )"
public void setMemberGroupIds(java.lang.String[] mbrGrpIds, java.lang.String anyOrAll)