Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/_includes/breadcrumb.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
</li>
{% endif %}

{% if page.parent == "Using NHS Notify" or page.mini_hub_topic == "Formatting" %}
{% if page.parent == "Using NHS Notify" or page.mini_hub_topic == "Formatting" or page.url contains
"/using-nhs-notify/personalising-your-messages" %}
<li class="nhsuk-breadcrumb__list-item">
<a class="nhsuk-breadcrumb__link" href="{{site.baseurl}}/using-nhs-notify">Using NHS Notify</a>
</li>
Expand Down Expand Up @@ -88,7 +89,8 @@
</a>
{% endif %}

{% if page.parent == "Using NHS Notify" or page.mini_hub_topic == "Formatting" %}
{% if page.parent == "Using NHS Notify" or page.mini_hub_topic == "Formatting" or page.url contains
"/using-nhs-notify/personalising-your-messages" %}
<a class="nhsuk-back-link" href="{{site.baseurl}}/using-nhs-notify">
<span class="nhsuk-u-visually-hidden">Back to &nbsp;</span>
Using NHS Notify
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
layout: mini-hub
title: Custom data
nav_title: Personalising your messages
nav_order: 3
permalink: /using-nhs-notify/personalising-your-messages/custom-data
section: Writing a message
mini_hub_topic: Personalising your messages
mini_hub_pages:
- title: Overview
url: /using-nhs-notify/personalising-your-messages
- title: Personal Demographic Service (PDS) data
url: /using-nhs-notify/personalising-your-messages/pds-data
- title: Custom data
url:
current: true
- title: Providing your own data
url: /using-nhs-notify/personalising-your-messages/providing-your-own-data

previous_page:
title: Personal Demographic Service (PDS) data
url: /using-nhs-notify/personalising-your-messages/pds-data
next_page:
title: Providing your own data
url: /using-nhs-notify/personalising-your-messages/providing-your-own-data
published: true
---

You can add custom personalisation fields to use your own data that’s not available through the Personal Demographics Service (PDS).

{% include components/inset-text.html
text='You can use your own data alongside PDS data to personalise the same message template. But you can only use custom data fields that do not already exist in PDS.'
%}

You need to provide the data for your custom personalisation fields in your API or MESH request. Find out more about [providing your own custom data](https://notify.nhs.uk/using-nhs-notify/personalising-your-messages/providing-your-own-data).

## Fields you cannot use

If you use your own data, you cannot use the following personalisation fields:

- any PDS personalisation fields
- emailAddress
- phoneNumber
- addressLine1 to addressLine7
- middleNames
- namePrefix
- nameSuffix
- date
- clientRef
- recipientContactValue
- template

{% include components/inset-text.html
text='Using these fields will cause custom personalisation to fail. This includes variations, like adding spaces, punctuation, and upper or lower case letters.'
%}

You can add words or underscores to custom personalisation fields, to make them different to the fields to avoid. For example, if you want to include GP surgery phone number, your personalisation field could be:

{% include components/inset-text.html
text='`((GP_phoneNumber))`'
%}

## Adding personalised links

To add personalised links and URLs, include personalisation fields for both the link text and the URL in your template. For example:

{% include components/inset-text.html
text='`[((link_text))](((link_URL)))`'
%}

If your NHS App message links to a service that requires users to sign in, your organisation must be set up with NHS login. Find out how to <a href="https://digital.nhs.uk/services/nhs-login/nhs-login-for-partners-and-developers/nhs-login-integration-toolkit/apply-for-nhs-login" target="_blank">apply for NHS login (opens in a new tab)</a>.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
layout: mini-hub
title: Overview
redirect_from: /using-nhs-notify/personalisation
nav_title: Personalising your messages
nav_order: 1
permalink: /using-nhs-notify/personalising-your-messages
section: Writing a message
mini_hub_topic: Personalising your messages
mini_hub_pages:
- title: Overview
url: /using-nhs-notify/personalising-your-messages
current: true
- title: Personal Demographic Service (PDS) data
url: /using-nhs-notify/personalising-your-messages/pds-data
- title: Custom data
url: /using-nhs-notify/personalising-your-messages/custom-data
- title: Providing your own data
url: /using-nhs-notify/personalising-your-messages/providing-your-own-data

previous_page:

next_page:
title: Personal Demographic Service (PDS) data
url: /using-nhs-notify/personalising-your-messages/pds-data
published: true
---

You can use NHS Notify to personalise messages with details like a recipient's name, appointment times, or reference numbers to your messages.

You can add personalisation fields to:

- NHS App messages
- emails
- text messages
- letters

You can personalise messages using data from the Personal Demographic Services (PDS), or your own custom data.

## Adding personalisation fields to message templates

You’ll need to add personalisation fields to your message templates, to send personalised messages to recipients.

Use double brackets to add personalisation fields to NHS App message, text message, or email templates. Do not include spaces in your personalisation fields. For example:

{% include components/inset-text.html
text='`Hello ((fullName)), your NHS Number is ((nhsNumber)). Your appointment is on ((appointmentDate)) at ((gpSurgery)).`'
%}

### Adding personalisation fields to letter templates

Use single curly brackets with d. at the start to add personalisation to letter templates. For example:

{% include components/inset-text.html
text='`Hello {d.fullName}, your NHS Number is {d.nhsNumber}. Your appointment is on {d.appointmentDate} at {d.gpSurgery}.`'
%}

You can read personalisation instructions while you’re editing a template.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
layout: mini-hub
title: Personal Demographic Service (PDS) data
nav_title: Personalising your messages
nav_order: 2
permalink: /using-nhs-notify/personalising-your-messages/pds-data
section: Writing a message
mini_hub_topic: Personalising your messages
mini_hub_pages:
- title: Overview
url: /using-nhs-notify/personalising-your-messages
- title: Personal Demographic Service (PDS) data
url:
current: true
- title: Custom data
url: /using-nhs-notify/personalising-your-messages/custom-data
- title: Providing your own data
url: /using-nhs-notify/personalising-your-messages/providing-your-own-data

previous_page:
title: Overview
url: /using-nhs-notify/personalising-your-messages
next_page:
title: Custom data
url: /using-nhs-notify/personalising-your-messages/custom-data
published: true
---

NHS Notify uses the Personal Demographic Service (PDS) to fill personalisation fields in your template. This happens when you [tell us who you want to message]({% link pages/using-nhs-notify/tell-us-who-you-want-to-message.md %}) using recipients’ NHS numbers.

You can use the following PDS fields in your message template:

- fullName
- firstName
- lastName
- nhsNumber
- date

Make sure your personalisation fields in your template match the PDS personalisation fields. This includes using the correct order of upper and lower case letters. For example:

{% include components/inset-text.html
text='`Hello ((fullName)), your NHS Number is ((nhsNumber)). Your appointment is on ((date)).`'
%}

Learn more about the <a href="https://digital.nhs.uk/services/personal-demographics-service" target="_blank">Personal Demographic Service (PDS) (opens in a new tab)</a>.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
layout: mini-hub
title: Providing your own data
nav_title: Personalising your messages
nav_order: 4
permalink: /using-nhs-notify/personalising-your-messages/providing-your-own-data
section: Writing a message
mini_hub_topic: Personalising your messages
mini_hub_pages:
- title: Overview
url: /using-nhs-notify/personalising-your-messages
- title: Personal Demographic Service (PDS) data
url: /using-nhs-notify/personalising-your-messages/pds-data
- title: Custom data
url: /using-nhs-notify/personalising-your-messages/custom-data
- title: Providing your own data
url:
current: true

previous_page:
title: Custom data
url: /using-nhs-notify/personalising-your-messages/custom-data
next_page:

published: true
---

Your developer or technical team should include data for your custom personalisation fields in your API or MESH request.

## If you use NHS Notify API

Include a personalisation block for each message in your API request.

For example, if you want to include `((gpSurgery))` and `((appointmentDate))` as custom personalisation fields, the personalisation block for one message will be:

{% include components/inset-text.html
text='`personalisation: {`<br>
`"gpSurgery": "The Health Centre, Knaresborough Road",`<br>
`"appointmentDate": "15 January 2027"`<br>
`}`'
%}

To find out where to add this in your request, go to <a href="https://digital.nhs.uk/developer/api-catalogue/nhs-notify#post-/v1/message-batches" target="_blank">NHS Notify API (opens in a new tab)</a>.

## If you use NHS Notify MESH

Include the custom personalisation fields as column headings in the CSV file you use in your request. Put the personalisation data for each message in the rows underneath, with one row per message.

The column heading should start with `personalisation_`  followed by the same wording as the personalisation field in your template.

For example, if your personalisation fields are `((gpSurgery))` and `((appointmentDate))`, the column headings will be:

{% include components/inset-text.html
text='`personalisation_gpSurgery`
`personalisation_appointmentDate`'
%}

The CSV file you use in your MESH request is different to the CSV example data file for custom personalisation fields.

Read more <a href="https://digital.nhs.uk/developer/api-catalogue/nhs-notify-mesh/sending-a-message" target="_blank">sending a message with NHS Notify MESH (opens in a new tab)</a>.

## Example data

After you request a proof, we’ll include example data in the proof we email to you. This allows you to check how personalisation will be displayed in your message.

The data in personalisation fields can affect message cost and length.

Find out how to [approve your messages before we send them]({% link pages/using-nhs-notify/approve-your-messages.md %}).
1 change: 1 addition & 0 deletions project.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"Codespaces",
"endfor",
"Nasar",
"personalisationexampledata",
"preinstalled",
"pythonist",
"rossbugginsnhs",
Expand Down
Loading