Successfully processing emails in ERMS can be a complex exercise.
Of course, depending on your requirements, ERMS can be implemented simple, or more complex.
ERMS basically consists of a few automated steps.
1. Receiving the email
2. A workflow
3. A set of ‘Factgathering services’
4. An ERMS Rule Policy
5. A set of ‘Action Handling services’
When you get the hang of the logic in ERMS, basically everything is possible. It actually turns out to be quite a powerful platform, where the cherry is the combination of the Factgathering services, Action handling services and the Rule Policy.
In my specific requirement I wanted to create an outbound call in a call list if certain requirements in the content of the email were met.
To cut thing short… if a certain field in the webform was filled with ‘Call Me Back’, I needed to create an outbound call in a call list.
Considering the above ingredients, I added a factgathering service to retrieve the values from the webform as described by my colleague Sandor here.
I then created an Action Handling Service to create an outbound call.
I added the Action to the ERMS Rule Policy.
So… The email is received, the workflow is started, the factgathering services determine this is a webform and adds the details from the webform to facts container.
The ERMS rule policy determines the actions to be processed.
If the requirements are met, the phonecall is created and added to the call list.
Adding the planned call in the call list.
To achieve this, I created an Action Handling Service calling a custom class in SPRO:
SAP Customizing Implementation Guide –> Customer Relationship Management –> E-Mail Response Management System –> Service Manager –> Define Services.
The service has three parameters: Call List, Campaign and Process Type
The class specified, in my case ZCL_CRM_ERMS_AH_CREATE_OUTB contains an interface to IF_CRM_ERMS_SERVICE.
In the execute method, I have created code to create an activity (using method cl_crm_email_utility=>create_activity) and a call (using method cl_tm_clm_interaction=>create).
After creating the service to create the call, you should also define this as an action in the ERMS context in SPRO:
SAP Customizing Implementation Guide –> Customer Relationship Management –> E-Mail Response Management System –> Define Repository.
Here, you should add the exact same action parameters.
As the call center manager probably will not know all call list guids by heart, I added a search help to the parameter.
As it didn’t exist yet, I create a fresh one.
Use interfaces IF_CRM_ERMS_RULE_FIS and IF_CRM_RULE_FIS_BOL_VALUEHLP_S in the class.
This allows us to enter the values in the rule modeler using a proper search help.
Using generic factgathering services to gather the facts from the incoming email and generic action handling services such as creating a call in a call list, allows you to glue all the components together is an easily maintainable rule modeler.