BEFORE_SENDING_MAIL
This user exit can be used to change the subject, content and/or the recipients of a mail. This affects all mails that are send out either manually via TM Notes or that are triggered automatically to notify the involved approvers about that their approval is requested…
Location for activation
TM Server
Template function Module
/RTC/TM_TMPL_BEFORE_SEND_MAIL
Interface
Import Parameters
Internal table TT_IMPORT_PARAMS
This table contains name/value pairs with the required information…
NAME | VALUE |
---|---|
SYSTEM | System that has initiated the mail |
TRKORR | Transport Request |
OWNER | Author of the Transport Request |
PJ_NAME | Project that is assigned to the Transport Request |
DESTI_NAME | Destination that is assigned to the Transport Request |
LEVEL_NAME | Current transport level of the Transport Request |
SHORTTEXT | Short text of the Transport Request |
SIGN_POS | Position of the approval that is requested ‘1’: Technical approval ‘2’: Content approval ‘3’: 2nd content approval |
SUBJECT | Subject of the mail |
CONTENT | Content of the mail (there can be multiple records with NAME=CONTENT) |
USER | Recipient of the mail (there can be multiple records with NAME=RECIPIENT) |
Export Parameters
Internal table TT_EXPORT_PARAMS
You can set name/value pairs for that table to control the further notification flow…
NAME | VALUE |
---|---|
MODIFY_CONTENT | ‘REPLACE’: The original content of the mail will be replaced by the text provided by TT_EXPORT_PARAMS records with NAME=CONTENT ‘SUPPLEMENT’: The original content of the mail will be extended by the text provided by records with NAME=CONTENT |
CONTENT | <Any text>: Depending on the value for MODIFY_CONTENT this text will replace the original content or it will be added to the original content (There can be multiple records with NAME=CONTENT) |
MODIFY_SUBJECT | ‘X’: Subject will be replaced with the text provided by TT_EXPORT_PARAMS record with NAME=SUBJECT |
MODIFY_USER | ‘X’: Recipient list will be replaced with recipients provided by TT_EXPORT_PARAMS record with NAME=USER |
USER | <Any SAP user name>: If MODIFY_USER is set to ‘X’, the recipient list will be replaced by this user (There can be multiple records with NAME=USER) |
SUBJECT | <Any text>: If MODIFY_SUBJECT is set to ‘X’, the subject will be replaced by this value. |
STOP_MAIL | ‘ ’ (default): Mail will be sent ‘X’: Mail will not be sent |
Example
The customer wants to add a disclaimer to each approval mail
Step 1 | Copy the function module /RTC/TM_TMPL_ BEFORE_SEND_MAIL to a new function module |
Add the following code:
Tt_export_params-name = ‘MODIFY_CONTENT’.
Tt_export_params-value = ‘SUPPLEMENT’.
append tt_export.
Tt_export_params-name = ‘CONTENT’.
Tt_export_params-value = <disclaimer_text1>.
append tt_export.
Tt_export_params-value = <disclaimer_text2>.
append tt_export.