Skip to content

Commit 04447c9

Browse files
authored
Merge pull request #269 from alphagov/python-dates-fix
Make the date format in snippet match GDS content guide
2 parents 5868e4e + 1251e30 commit 04447c9

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

source/documentation/client_docs/_python.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ If a template has placeholder fields for personalised information such as name o
8484
```python
8585
personalisation={
8686
"first_name": "Amala",
87-
"appointment_date": "2018-01-01 at 01:00PM",
87+
"appointment_date": "1 January 2018 at 01:00PM",
8888
},
8989
```
9090

9191
You can leave out this argument if a template does not have any placeholder fields for personalised information.
9292

9393
##### reference (optional)
9494

95-
A unique identifier you can create if necessary. This reference identifies a single unique message or a batch of messages. It must not contain any personal information such as name or postal address. For example:
95+
An identifier you can create if necessary. This reference identifies a single unique message or a batch of messages. It must not contain any personal information such as name or postal address. For example:
9696

9797
```python
9898
reference="your reference", # optional string - identifies notification(s)
@@ -129,7 +129,7 @@ If the request to the client is successful, the client returns a `dict`:
129129
"id": "740e5834-3a29-46b4-9a6f-16142fde533a", # required string - notification ID
130130
"reference": "your reference", # optional string - reference you provided when sending the message
131131
"content": {
132-
"body": "Hi Amala, your appointment is on 2018-01-01 at 01:00PM", # required string - message content
132+
"body": "Hi Amala, your appointment is on 1 January 2018 at 1:00pm", # required string - message content
133133
"from_number": "GOVUK" # required string - sender name / phone number
134134
},
135135
"uri": "https://api.notifications.service.gov.uk/v2/notifications/740e5834-3a29-46b4-9a6f-16142fde533a", # required string
@@ -204,7 +204,7 @@ If a template has placeholder fields for personalised information such as name o
204204
```python
205205
personalisation={
206206
"first_name": "Amala",
207-
"appointment_date": "2018-01-01 at 01:00PM",
207+
"appointment_date": "1 January 2018 at 1:00pm",
208208
# pass in a list and it will appear as bullet points in the message:
209209
"required_documents": ["passport", "utility bill", "other id"],
210210
},
@@ -213,7 +213,7 @@ You can leave out this argument if a template does not have any placeholder fiel
213213

214214
##### reference (optional)
215215

216-
A unique identifier you can create if necessary. This reference identifies a single unique email or a batch of emails. It must not contain any personal information such as name or postal address. For example:
216+
An identifier you can create if necessary. This reference identifies a single unique email or a batch of emails. It must not contain any personal information such as name or postal address. For example:
217217

218218
```python
219219
reference="your reference", # optional string - identifies notification(s)
@@ -271,7 +271,7 @@ If the request to the client is successful, the client returns a `dict`:
271271
"reference": "your reference", # optional string - reference you provided when sending the message
272272
"content": {
273273
"subject": "Your upcoming pigeon registration appointment", # required string - message subject
274-
"body": "Dear Amala\r\n\r\nYour pigeon registration appointment is scheduled for 2018-01-01 at 01:00PM.\r\n\r\nPlease bring:\r\n\n\n* passport\n* utility bill\n* other id\r\n\r\nYours,\r\nPigeon Affairs Bureau", # required string - message content
274+
"body": "Dear Amala\r\n\r\nYour pigeon registration appointment is scheduled for 1 January 2018 at 1:00pm.\r\n\r\nPlease bring:\r\n\n\n* passport\n* utility bill\n* other id\r\n\r\nYours,\r\nPigeon Affairs Bureau", # required string - message content
275275
"from_email": "pigeon.affairs.bureau@notifications.service.gov.uk", # required string - "FROM" email address, not a real inbox
276276
"one_click_unsubscribe_url": "https://example.com/unsubscribe.html?opaque=123456789", # optional string
277277
},
@@ -335,7 +335,7 @@ with open("file.pdf", "rb") as f:
335335
...
336336
personalisation={
337337
"first_name": "Amala",
338-
"appointment_date": "2018-01-01 at 01:00PM",
338+
"appointment_date": "1 January 2018 at 1:00pm",
339339
"link_to_file": prepare_upload(f),
340340
}
341341
```
@@ -364,7 +364,7 @@ with open("file.csv", "rb") as f:
364364
...
365365
personalisation={
366366
"first_name": "Amala",
367-
"appointment_date": "2018-01-01 at 01:00PM",
367+
"appointment_date": "1 January 2018 at 1:00pm",
368368
"link_to_file": prepare_upload(f, filename="amala_pigeon_affairs_bureau_invite.csv"),
369369
}
370370
```
@@ -397,7 +397,7 @@ with open("file.pdf", "rb") as f:
397397
...
398398
personalisation={
399399
"first_name": "Amala",
400-
"appointment_date": "2018-01-01 at 01:00PM",
400+
"appointment_date": "1 January 2018 at 1:00pm",
401401
"link_to_file": prepare_upload(f, confirm_email_before_download=False),
402402
}
403403
```
@@ -424,7 +424,7 @@ with open("file.pdf", "rb") as f:
424424
...
425425
personalisation={
426426
"first_name": "Amala",
427-
"appointment_date": "2018-01-01 at 01:00PM",
427+
"appointment_date": "1 January 2018 at 1:00pm",
428428
"link_to_file": prepare_upload(f, retention_period="4 weeks"),
429429
}
430430
```
@@ -439,7 +439,7 @@ If the request to the client is successful, the client returns a `dict`:
439439
"reference": "your reference", # optional string - reference you provided when sending the message
440440
"content": {
441441
"subject": "Your upcoming pigeon registration appointment", # required string - message subject
442-
"body": "Dear Amala\r\n\r\nYour pigeon registration appointment is scheduled for 2018-01-01 at 01:00PM.\r\n\r\n Here is a link to your invitation document:\r\nhttps://documents.service.gov.uk/d/YlxDzgNUQYi1Qg6QxIpptA/th46VnrvRxyVO9div6f7hA?key=R0VDmwJ1YzNYFJysAIjQd9yHn5qKUFg-nXHVe3Ioa3A\r\n\r\nPlease bring the invite with you to the appointment.\r\n\r\nYours,\r\nPigeon Affairs Bureau", # required string - message content - see that the link to document is embedded in the message content
442+
"body": "Dear Amala\r\n\r\nYour pigeon registration appointment is scheduled for 1 January 2018 at 1:00pm.\r\n\r\n Here is a link to your invitation document:\r\nhttps://documents.service.gov.uk/d/YlxDzgNUQYi1Qg6QxIpptA/th46VnrvRxyVO9div6f7hA?key=R0VDmwJ1YzNYFJysAIjQd9yHn5qKUFg-nXHVe3Ioa3A\r\n\r\nPlease bring the invite with you to the appointment.\r\n\r\nYours,\r\nPigeon Affairs Bureau", # required string - message content - see that the link to document is embedded in the message content
443443
"from_email": "pigeon.affairs.bureau@notifications.service.gov.uk", # required string - "FROM" email address, not a real inbox
444444
"one_click_unsubscribe_url": "https://example.com/unsubscribe.html?opaque=123456789", # optional string
445445
},
@@ -545,15 +545,15 @@ personalisation={
545545
"address_line_4": "Middlesex",
546546
"address_line_5": "SW14 6BF", # last line of address you include must be a postcode or a country name outside the UK
547547
"name": "Amala",
548-
"appointment_date": "2018-01-01 at 01:00PM",
548+
"appointment_date": "1 January 2018 at 1:00pm",
549549
# pass in a list and it will appear as bullet points in the letter:
550550
"required_documents": ["passport", "utility bill", "other id"],
551551
}
552552
```
553553

554554
##### reference (optional)
555555

556-
A unique identifier you can create if necessary. This reference identifies a single unique letter or a batch of letters. It must not contain any personal information such as name or postal address. For example:
556+
An identifier you can create if necessary. This reference identifies a single unique letter or a batch of letters. It must not contain any personal information such as name or postal address. For example:
557557

558558
```python
559559
reference="your reference" # optional string - identifies notification(s)
@@ -569,7 +569,7 @@ If the request to the client is successful, the client returns a `dict`:
569569
"reference": "your reference", # optional string - reference you provided when sending the message
570570
"content": {
571571
"subject": "Your upcoming pigeon registration appointment", # required string - letter heading
572-
"body": "Dear Amala\r\n\r\nYour pigeon registration appointment is scheduled for 2018-01-01 at 01:00PM.\r\n\r\nPlease bring:\r\n\n\n* passport\n* utility bill\n* other id\r\n\r\nYours,\r\nPigeon Affairs Bureau", # required string - letter content
572+
"body": "Dear Amala\r\n\r\nYour pigeon registration appointment is scheduled for 1 January 2018 at 1:00pm.\r\n\r\nPlease bring:\r\n\n\n* passport\n* utility bill\n* other id\r\n\r\nYours,\r\nPigeon Affairs Bureau", # required string - letter content
573573
},
574574
"uri": "https://api.notifications.service.gov.uk/v2/notifications/3d1ce039-5476-414c-99b2-fac1e6add62c", # required string
575575
"template": {
@@ -615,7 +615,7 @@ with open("path/to/pdf_file.pdf", "rb") as pdf_file:
615615

616616
##### reference (required)
617617

618-
A unique identifier you create. This reference identifies a single unique precompiled letter or a batch of precompiled letters. It must not contain any personal information such as name or postal address.
618+
An identifier you create. This reference identifies a single unique precompiled letter or a batch of precompiled letters. It must not contain any personal information such as name or postal address.
619619

620620
```python
621621
reference="your reference" # required string - identifies notification(s)
@@ -712,7 +712,7 @@ If the request to the client is successful, the client will return a `dict`:
712712
"id": "f33517ff-2a88-4f6e-b855-c550268ce08a", # required string - template ID
713713
"uri": "/v2/template/{id}/{version}" # required string
714714
},
715-
"body": "Hi Amala, your appointment is on 2018-01-01 at 01:00PM", # required string - body of notification
715+
"body": "Hi Amala, your appointment is on 1 January 2018 at 1:00pm", # required string - body of notification
716716
"subject": "Your upcoming pigeon registration appointment", # required string for email - subject of email
717717
"created_at": "2024-05-17 15:58:38.342838", # required string - date and time notification created
718718
"created_by_name": "Charlie Smith", # optional string - name of the person who sent the notification if sent manually
@@ -827,7 +827,7 @@ You can leave out this argument to ignore this filter.
827827

828828
##### reference (optional)
829829

830-
A unique identifier you can create if necessary. This reference identifies a single unique message or a batch of messages. It must not contain any personal information such as name or postal address. For example:
830+
An identifier you can create if necessary. This reference identifies a single unique message or a batch of messages. It must not contain any personal information such as name or postal address. For example:
831831

832832
```python
833833
reference="your reference" # optional string - reference you provided when sending the message
@@ -882,7 +882,7 @@ If the request to the client is successful, the client returns a `dict`.
882882
"id": "f33517ff-2a88-4f6e-b855-c550268ce08a", # required string - template ID
883883
"uri": "/v2/template/{id}/{version}" # required string
884884
},
885-
"body": "Hi Amala, your appointment is on 2018-01-01 at 01:00PM", # required string - body of notification
885+
"body": "Hi Amala, your appointment is on 1 January 2018 at 1:00pm", # required string - body of notification
886886
"subject": "Your upcoming pigeon registration appointment", # required string for email - subject of email
887887
"created_at": "2024-05-17 15:58:38.342838", # required string - date and time notification created
888888
"created_by_name": "Charlie Smith", # optional string - name of the person who sent the notification if sent manually
@@ -1202,7 +1202,7 @@ response = notifications_client.post_template_preview(
12021202
template_id="f33517ff-2a88-4f6e-b855-c550268ce08a",
12031203
personalisation={
12041204
"first_name": "Amala",
1205-
"appointment_date": "2018-01-01 at 01:00PM",
1205+
"appointment_date": "1 January 2018 at 1:00pm",
12061206
}
12071207
)
12081208
```
@@ -1228,7 +1228,7 @@ If a template has placeholder fields for personalised information such as name o
12281228
```python
12291229
personalisation={
12301230
"first_name": "Amala",
1231-
"appointment_date": "2018-01-01 at 01:00PM",
1231+
"appointment_date": "1 January 2018 at 1:00pm",
12321232
"required_documents": ["passport", "utility bill", "other id"],
12331233
},
12341234
```
@@ -1243,7 +1243,7 @@ If the request to the client is successful, you receive a `dict` response.
12431243
"type": "sms / email / letter" , # required string
12441244
"version": 3,
12451245
# required string - body of notification
1246-
"body": "Dear Amala\r\n\r\nYour pigeon registration appointment is scheduled for 2018-01-01 at 01:00PM.\r\n\r\n Here is a link to your invitation document:\r\n\n\n* passport\n* utility bill\n* other id\r\n\r\nPlease bring the invite with you to the appointment.\r\n\r\nYours,\r\nPigeon Affairs Bureau",
1246+
"body": "Dear Amala\r\n\r\nYour pigeon registration appointment is scheduled for 1 January 2018 at 1:00pm.\r\n\r\n Here is a link to your invitation document:\r\n\n\n* passport\n* utility bill\n* other id\r\n\r\nPlease bring the invite with you to the appointment.\r\n\r\nYours,\r\nPigeon Affairs Bureau",
12471247
# required string for emails, empty for sms and letters - html version of the email body
12481248
"html": '<p style="Margin: 0 0 20px 0; font-size: 19px; line-height: 25px; color: #0B0C0C;">Dear Amala</p> ... [snippet truncated for readability]',
12491249
# required string for email and letter - subject of email / heading of letter

0 commit comments

Comments
 (0)