Toggle menu

Subscriptions Setup

Configuration

Configuration is held in a single end point at config.[env].Subscriptions.getConfig. It is used by both the subscription preferences form and the end points used to generate the alert emails.

An annotated example can be found at config.example.Subscriptions.getConfig.

Properties

NameTypeDescription
ctmObjectThe comms template manager application and variations to use. The default application name is "Subscriptions" and the two variants are "Alerts" and "PIN"
emailObjectEach key in this object is a named subsite and its value an object which defines various email settings
email.subsiteNameObjectAn object with the following properties, and subsiteName the internal name of the subsite:
  • address - the email "from" address
  • name - the email "from" name
  • lang - the language variant of the email template to use
  • template - the name of the email template to use. We recommend organising templates by subsite, see Subscriptions Setup - Email Templates
imageObjectAn object with the single property "constraint". This provides resize instructions when fetching article information and can be used in your email templates
metadataObjectSee below
objectObjectAn object with the single property "type". This is the object type used to store subscription data. The default value is "SUBSCRIPTION"
scheduleObjectAn object with the single property "period". This is an integer and defines the number of days to look back for article updates. Take care to update your end point schedule if you change this from the default 7
userObjectAn object with the properties whose keys are the names of subsites and values the IDs of website users able to access secure content on that subsite

function(params, credentials) {
    return {
        ctm: {
            application: 'Subscriptions',
            variations: {
                alerts: 'Alerts',
                pin: 'PIN'
            }
        },
        dates: {
            format: 'D MMMM YYYY'
        },
        email: {
            subsitename: {
                address: '[email protected]',
                name: '{Client Subsite} Updates',
                lang: 'EN',
                template: 'Client Subsite'
            }
        },
        image: {
            constraint: "standard"
        },
        metadata: {
            subsitename: [{
                groups: [],
                properties: [{
                    title: 'Property 1',
                    property: 1
                }, {
                    title: 'Property 2',
                    property: 2
                }],
                parent: {
                    id: 1234,
                    title: 'Latest Group 1 Articles'
                }
            }, {
                groups: [],
                properties: [{
                    title: 'Property 5',
                    property: 5
                }],
                parent: {
                    id: 4321,
                    title: 'Latest Group 2 Articles',
                }
            }]
        },
        object: {
            type: 'SUBSCRIPTION'
        },
        schedule: {
            period: 7
        },
        user: {
            subsitename: 1234
        }
    };
}

Metadata

The metadata defined in your configuration is used to populate the checkboxes on the subscriptions management form, and by the product to work out if an article should be added to the subscriptions email.

The metadata object has the following properties.

NameTypeDescription
[subsitename]ArrayEach property in metadata should match the internal name of the subsite for which it is defined, and will be an array of objects, each representing a "subscription group"
[subsitename].groupsArrayAn array of website user group names. Only users in this group will be able to see these subscription options on the manage subscription form. Leave it empty to all all groups
[subsitename].propertiesArrayEach object in this array represents a metadata property. Enter a title and the metadata property ID. Each property creates a checkbox accordion on the manage subscription form with the values of the property
[subsitename].parentObjectThe title entered here is used in the subscription emails as the heading above links to the new articles. The ID is an article ID. Only articles (with relevant metadata) created beneath this parent will be considered for subscriptions

Example

 

Last modified on 3 March 2026