Toggle menu

Requesting Templates

Templates are requested via a single end point: goss.CommsTemplateManager.GetTemplate.

Request Parameters

NameTypeDescription
applicationString, requiredThe name of the application
templateString, requiredThe name of the template
variationString, requiredThe name of the variation
langString, optionalThe name of the language version. Either "EN", "CY" or "GD". Defaults to "EN" if not provided

Example Request

function(params, credentials) {
    var result = this.invokeEP('goss.CommsTemplateManager.GetTemplate', {
        "application": "Job Applications",
        "template": "Standard Reply",
        "variation": "1",
        "lang": "EN"
    });
    return result;
}

Response

The result object includes status information, and the template's subject, body and SMS message.

NameTypeDescription
successBooleantrue if everything went ok
inactiveBooleantrue if the template has been flagged as inactive
fallbackBooleanfalse if a template has been found, true if a "fallback" has been used
subjectStringThe subject line of the template
bodyStringThe template body
smsmsgStringThe SMS message

Example Response

{
    "jsonrpc": "2.0",
    "id": 600,
    "result": {
        "success": true,
        "inactive": false,
        "fallback": false,
        "subject": "Thanks for your application",
        "body": "<p>Hi {{form_NAME}},</p>\n<p>Thanks for applying for the {{form_ROLE}}.</p>\n<p>We'll be in touch soon.</p>",
        "smsmsg": ""
    }
}

Using the Template

This is an example workflow Mail Task using the response from a call to get a template. The response from the end point has been stored in the APICALLRESULT process variable. Note how the task has to be set to "Use handlebars".

Using a CTM Template
 

Last modified on 19 February 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon