Toggle menu

sendLetter

Description

Sends a letter to the provided address. It will use a combination of the templateId and personalisation to provide the contents of the letter.

Parameters

NameTypeDescription
templateIdString, requiredThe ID of the template to use
personalisationObject, requiredAn object containing the different fields to input into the template. Must include the address the letter is being delivered to
referenceString, optionalAn optional reference that can be used to identify an letter
apiKeyNameString, optionalSpecify the name of the API key you want to use. Names and keys are defined in the worker configuration. If not supplied the default will be used

Example Request

function(params, credentials) {  
    let result = this.callWorkerMethod("govnotify", "sendLetter", {    
        "templateId": "00000000-0000-0000-0000-000000000000",
        "personalisation": {            
            "firstName": "John",
            "lastName": "Smith",
            "address_line_1": "24 Darklake View",
            "address_line_2": "Plymouth",
            "postcode": "PL6 7TL"        
        },
        "reference": "Reference"
    });  
    return result;
}

Last modified on August 01, 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon