Overview

Merges a standard Sugar Email Template and returns the merged data

Summary

The request will take a merge a Standard Sugar Email Template against a given record

Request Arguments

Name Type Description Required
targetRecordModule String Record Module True
targetRecordId String Record ID True
targetTemplateId String Template ID True
emailToField Boolean Prepopulate Email Recipient? False
emailToData Array Sugar logic formula that will evaluate the recipient list False

Request Example

{
    "targetTemplateId": "7d2e21a6-8a76-a74f-bb53-535620211304",
    "targetRecordId": "3232sda6-8a76-a74f-bb53-535620232304",
    "targetRecordModule": "Accounts",
    "emailToField": true,
    "emailToData": {
        "formulaElement": "toString(\"test@sugarcrm.com\")"
    }
}

Response

The response will be an object containing the following fields:
Name Type Description
body String Email Body
subject String Email Subject
description String Email Description (taken from the Email Template record)
emailTo Array or Boolean List of email recipients.

Response Example

{
    "body": "Hi Rity, Please check our website: https://www.sugarcrm.com/",
    "subject": "Casual Friday",
    "description": "Weekly updates",
    "emailTo" : [
        {
            "email_address": "test@sugarcrm.com",
            "email_address_id": "1e2521a6-8a76-a74f-bb53-535620211304",
        }
    ]
}

Change Log

Version Change
v11_13 Added /actionButton/evaluateEmailTemplate POST endpoint.