Writing a message

Personalisation

You can send personalised messages by adding personalisation fields to a single template.

Use double brackets to add a personalisation field to your content. Do not include spaces in your personalisation fields. For example:

Information:

Hello ((fullName)), your NHS Number is ((nhsNumber))

You can use:

Personal Demographics Service (PDS) personalisation fields

NHS Notify uses the Personal Demographics Service (PDS) to find and populate certain personalisation fields for each recipient. This happens automatically when you tell us who you want to message using recipients’ NHS numbers.

To use PDS personalisation fields in your templates, choose from the following list:

  • fullName
  • firstName
  • lastName
  • nhsNumber
  • date
Information:

Make sure your personalisation fields exactly match the PDS personalisation fields. This includes using the correct order of upper and lower case letters.

Custom personalisation fields

You can add custom personalisation fields that use your own personalisation data.

If you’re using NHS Notify API

Include a personalisation block in your API request.

For example, if you wanted to include ‘practice’ as a personalisation field, the personalisation block would be:

Information:

“practice”: “PRACTICE_NAME”,

Read the API documentation to find out where to put this in your request.

If you’re using NHS Notify MESH

Include the personalisation fields as columns in your CSV file.

The column names should start with ‘personalisation_’, followed by the same wording as the personalisation fields in your template.

For example, if you wanted to include ‘practice’ as a personalisation field, the column name would be:

Information:

nhsNumber,requestItemRefId,personalisation_practice

Providing example data

The data used in your personalisation fields can affect the formatting and length of your messages. This could make some messages cost more than expected.

You’ll need to provide example data if you’re using custom personalisation fields. This is so that we can show you what your templates will look like with different lengths of data in your personalisation fields.

Download and complete our example personalisation data spreadsheet.

The personalisation fields in your content must match the fields in the ‘personalisation field’ column.

You’ll need to provide short, medium and long lengths of example data for each of your personalisation fields.

For example, if you had ((hospital_address_line)) as a personalisation field, you might choose the following example data:

Information:
  • Hospital A - short length
  • Hospital ABCDE - medium length
  • Hospital ABCDEFGHIJKLMN - long length

It’s up to you to decide how many characters to use for the different lengths.

If your data will be a fixed length for a particular personalisation field, use 3 different examples of the same length.

Your example data does not need to be real data.

Fields to avoid for custom personalisation

If you want to use custom personalisation, do not use the following personalisation fields:

  • emailAddress
  • phoneNumber
  • addressLine1
  • addressLine2
  • addressLine3
  • addressLine4
  • addressLine5
  • addressLine6
  • addressLine7
  • PDS personalisation fields

Custom personalisation will not work if you try to add it using these personalisation fields. This includes variations such as spaces and upper or lower cases.

You can include extra words in your custom personalisation fields to make them different from the fields to avoid.

For example, if you wanted to include GP practice phone number as a custom personalisation field, your personalisation field could be:

Information:

((GP_phoneNumber))