CRM and CX Blogs by Members
Find insights on SAP customer relationship management and customer experience products in blog posts from community members. Post your own perspective today!
Showing results for 
Search instead for 
Did you mean: 
Step by step guide on how to trigger an email through mail forms using standard sap crm rule policy on service request transaction saved.

Pre-requisite -

SPRO->Customer Relationship Management->Marketing->Marketing Planning and Campaign Management  ->Maintain Attribute Contexts for Mail Forms

  1. Maintain Attribute Contexts for Mail Forms.- you can define custom Attribute context and assign custom structure with all fields to get visible on UI.

  2. Mail form should be configured on UI with its usage and attribute context.

If you are on CRM 7.0 or above version sending e-mail when service request is saved is a standard functionality and sending mail using mail forms can be achieved by Rule policy with Intent Driven Interaction context.

SPRO->Customer Relationship Management->Interaction Center WebClient->Additional Functions   ->Intent-Driven Interactions->

  1. Service Manager - Select the appropriate profile (ex.  Z_ERMS_ROUTE) and in called services you need an entry of RE_RULE_EXEC.

  2. Define Repository - Select ICRULE Intent Driven Interaction (IC WebClient) Context where you have define custom attributes with custom Fact Gathering Srvc and its attribute context class, actions and its parameters.


3. Define Events in Repository- Use standard event as BTCreated.

4. Define Services (Action handling) and  fact gathering services in Customising in E-Mail Response Management System -> Service Manager -> Define Services and assign them to attributes in Define Repository.

for custom transaction related attributes you must create a copy of this service id and If you defined a new class, it must implement the IF_CRM_ERMS_SERVICE interface.

Go to business role IC_MANAGER and configure a rule policy as below.

  1. Create New policy and add your Business Role at the header.

  2. Add IC Events 'OrderSaved' at the header that is configured..

  3. Create rules as Condition - If Current Event Equals Order was saved & Action - Send Out-Going E-Mail Using Mail Form

  4. E-Mail Subject -  'Trigger Email'.

  5. Sender's E-Mail Adress 'email id'

  6. Mail Form 'ZMailform that is configured.

To get context attributes values of mail form you can refer below class and its method.


Get Customer id based on partner function of that service request and then get email id of that customer using  BAPI_BUPA_CENTRAL_GETDETAIL.

Use standard SEND_ERMS_MAIL method to send email to customer.

Use   standard cl_crm_erms_utils=>link_ir_email to link email and service request.

To raise a custom event in intent driven interaction use below code.
  DATA : lr_event     TYPE REF TO cl_crm_ic_event.
DATA : lr_event_srv TYPE REF TO if_crm_ic_event_srv.

CLASS cl_crm_ic_services DEFINITION LOAD.
lr_event->set_name( 'BTCreated' ).
lr_event_srv = cl_crm_ic_services=>get_event_srv_instance( ).
lr_event_srv->raise( lr_event ).