Show TOC

Function documentationMail Message Templates Locate this document in the navigation structure

 

Mail templates are used to define the form and content of the e-mail messages sent in SAP Sourcing. The product ships with one mail template for each mail type defined in the system. A mail type is key, or name, used by the software to determine what mail template to use for any given business task. You map mail message templates to mail types in Mail Configurations.

The standard mail templates that ship with the product cannot be edited. These are upgraded automatically when new patches are applied. Mail templates can, however, be duplicated and customized to suite specific needs.

Any custom mail templates you create are not changed during the upgrade process. Although this does not typically pose a problem, it is something to consider, however, when making changes to mail content.

Mail Template Tokens

Mail templates make significant use of mail tokens when describing the message content. Tokens are placeholders or variables that are filled in when the application generates the e-mail messages.

A complete list of tokens is available in the on-line Reference Guide (RG).

Note Note

Global tokens are for internal use and may produce unexpected results if used. Tokens not labeled Global are mail-type specific and available for use by all users.

End of the note.

To use a mail template token, enter the name of the token surrounded by % symbols.

Example Example

The following text will substitute the document owner's name into the message:The document owner, %OWNER_FIRST_LAST_NAME%, should be notified of any changes.

End of the example.
Mail Template Macros

The following macros are available for use in mail templates. These macros provide for a degree of logic when describing e-mail messages.

EXISTS

You can use the EXISTS macro to conditionally include content in your message. The syntax is:

EXISTS(token,value_if_present,value_if_not_present)

You can use this feature in two ways. First, you can use it to leave out text based on the presence of a specific token. If the URL token is not always there, for example, the following will take that into account: EXISTS(URL,"The URL is: %URL%")

Another common use of this feature is to model the if-then-else concept:

EXISTS(URL,"The URL is: %URL%","You have no URL")

RES_ID

Use the RES_ID macro to pull in a string from the resource database.

RES_ID(cterms$cterm.publish_date)

This token can also be used in the subject of the mail.

FORMAT

This macro wraps the string in the given html tag if the user prefers html e-mail.

FORMAT("htmlTag", "string") If the user prefers plain text, only the string is used (no html).

Example Example

FORMAT("b", "Posted By:") -- Display bold text

End of the example.
LINK

This macro embeds a URL into the message. linkString is the visible display name and linkUrl is the target URL.

LINK(linkString, linkUrl)

If the user prefers plain text, only the linkUrl is used.

Example Example

LINK("Unsubscribe", "%UNSUBSCRIBE_URL%")

End of the example.
Enabling Return Receipts

You can enable return receipts to be sent for system-generated e-mails. Return receipts are only applicable when a buy-side user is listed in the e-mail Reply-to field. Suppliers will never receive return receipts.

To enable return receipts, do the following:

  1. On the Account Properties tab of the User Account document, check the Return Receipt box. For more information, see Buy-side User Accounts.

  2. Set the messaging.mail_reply_policy to DEFER_TO_MAILTYPE. For more information, see System Properties.

  3. Ensure that the Mail Type originates from the Owner. For more information, see Field help for Mail Message Template Summary page.