Skip to Content
Technical Articles

Adding Placeholders in Email template

Hello All,

The purpose of this document is to add placeholders in the customized email templates.

Overview

If you want to send a personalized email in mass to a particular group we create a HTML template with the desired layout, desired mail body and placeholders for the various attributes to be added in the email like signature, date, place, quotation ID etc.

Advantage

Use custom placeholders in e-mail templates to determine fields dynamically in emails like name, date place and id.

Prerequistes

  • The main templates should be created and to make the mail templates visible in WEBUI you need to assign the profile to the attribute in the Organizational model. You can assign mail profiles per teams, so you can have different mail templates per team. Transaction in SAP GUI: PPOMA_CRM
  • Need to know the recipients and type of placeholders you need to add. If it is customized or standard needs to be identified and their respective function module needs to be identified.

 

Steps to configure

1)Logon to SAP GUI and open t-code SPRO

Flow the below path:

SPRO->CRM-> Shared Service Center: Cross Scenario Settings->Mail Handling -> Maintain Mail Profiles

Choose Transaction Type

Then you click on Define Mail Profile

Take an existing one and copy! Or you can create a new one

Mail Profile = Template ID

Form Name = Template ID ( You cans elect a standard one or create the same as your mail template)

SNS = Standard (IF its confidential and only for certain business user you can select Business or confidential as per requirement)

Description = Any description

Email Address = add email for SSC if available

 

Fill all in and hit ENTER and then save.

It will ask for a customizing Transport request.

Then select the row and click on Define Recipients

Here

Recipient ID = Number

Determination logic = Select from F4 help. Chose a standard class

Parameter = type of person sending the email like sold to party(00001), contacting person, Team etc

Function = TO, CC, BCC( select any one based on the requirement)

Then click on Define Mail variables

Structure = Name of a structure (Can be standard or customized)

Component Name = The name of your place holder

Function Module = Standard or customised based on the requirement.

For example if the first name of the contact person you want only for your transaction type then we can write a small custom function module passing the value to the structure and give the function module name here.

 

Sample code:

INSERT iv_header_guid INTO TABLE lt_header_guid.

CALL FUNCTION ‘CRM_ORDER_READ’
EXPORTING
it_header_guid       = lt_header_guid
IMPORTING
et_partner           = lt_partner
EXCEPTIONS
document_not_found   = 1
error_occurred       = 2
document_locked      = 3
no_change_authority  = 4
no_display_authority = 5
no_change_allowed    = 6
OTHERS               = 7.

IF sy-subrc <> 0.
RAISE error_occured.
ENDIF.

* Read based on the requirement
READ TABLE lt_partner WITH KEY partner_fct =’XXX001′ INTO ls_partner.

lv_contact_name = ‘XXXTEST’
IF sy-subrc = 0.

IF  iv_structure IS NOT INITIAL.
IF iv_field IS NOT INITIAL.
* The structure and field were handed over
ls_mail_placeholder-value = lv_contact_name.
CONCATENATE iv_structure ‘-‘ iv_field
INTO ls_mail_placeholder-name.
APPEND ls_mail_placeholder TO ct_mail_placeholder.
ENDIF.
ELSE.
RAISE parameter_missing.
ENDIF.

ENDIF.

 

 

 

Then select on save.

 

This is how you define place holders.

 

After defining this to make note templates visible in the UI you have to create a profile and assign mail templates.

SPRO->CRM-> Interaction Center WebClientàBasic Settings->Communication Channels-> Define Standard Response Groups

Create a profile and assign mail templates that you would like to use for the notes tab according to the list.

Last step is to assign the profile to the organizational unit which should see the templates in PPOMA_CRM.

 

Then once done you can see the placeholders in the mail template……

 

Please let me know your thoughts, doubts in the comment section below, and if you enjoyed, please like and share.

Happy blogging and sharing everyone!

Be the first to leave a comment
You must be Logged on to comment or reply to a post.