Templates

Templates

Handle Tillhub Templates from the v1 Model.

Templates will drive email and document behaviours and layouts.

Constructor

new Templates()

Source:
Example
const Tillhub = require('@tillhub/node-sdk')

const th = new Tillhub({
  credentials: {
    username: 'user@example.com',
    password: '123455'
  }
})

await th.init()
const templates = th.templates()

const { data, metadata } = await templates.getAll()
console.log(data) // [...]

Methods

create(body, optionsOrCallbackopt, callbackopt)

Create a template.

Parameters:
Name Type Attributes Description
body Object

object defining a template

optionsOrCallback Object | function <optional>

options for templates with allowed paramaters, or specify an optional callback

callback function <optional>

optional callback. If not specified, this function returns a promise

Source:

getAll(queryOrCallbackopt, callbackopt)

Get all templates from client account.

Parameters:
Name Type Attributes Description
queryOrCallback Object | function <optional>

query for templates with allowed paramaters, or specify an optional callback

callback function <optional>

optional callback. If not specified, this function returns a promise

Source:

put(body, optionsOrCallbackopt, callbackopt)

Replance propertise on a template.

Parameters:
Name Type Attributes Description
body Object

object defining template properties

optionsOrCallback Object | function <optional>

options for templates with allowed paramaters, or specify an optional callback

callback function <optional>

optional callback. If not specified, this function returns a promise

Source: