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
Name | Type | Description |
---|---|---|
templateId | String, required | The ID of the template to use |
personalisation | Object, required | An object containing the different fields to input into the template. Must include the address the letter is being delivered to |
reference | String, optional | An optional reference that can be used to identify an letter |
apiKeyName | String, optional | Specify 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