// associate the email with anonymous user TODO: do we need a custom contact mech purpose type, say MARKETING_EMAIL?
input = UtilMisc.toMap("userLogin", userLogin, "emailAddress", email, "partyId", "_NA_", "fromDate", fromDate, "contactMechPurposeTypeId", "OTHER_EMAIL");
Map<String, Object> serviceResults = dispatcher.runSync("createPartyEmailAddress", input);
if (ServiceUtil.isError(serviceResults)) {
throw new GenericServiceException(ServiceUtil.getErrorMessage(serviceResults));
}
String contactMechId = (String) serviceResults.get("contactMechId");
// create a new association at this fromDate to the anonymous party with status accepted
input = UtilMisc.toMap("userLogin", userLogin, "contactListId", contactList.get("contactListId"),
"partyId", "_NA_", "fromDate", fromDate, "statusId", "CLPT_ACCEPTED", "preferredContactMechId", contactMechId);
serviceResults = dispatcher.runSync("createContactListParty", input);
if (ServiceUtil.isError(serviceResults)) {
throw new GenericServiceException(ServiceUtil.getErrorMessage(serviceResults));
}
} catch (GenericEntityException e) {
String error = UtilProperties.getMessage(resourceOrder, "checkhelper.problems_reading_database", locale);
Debug.log(e, error + e.getMessage(), module);
return ServiceUtil.returnError(error);