Skip to content

Commit e2c3400

Browse files
authored
Docs: Split email notifications and webhook notifications into separate howtos (#10396)
* Split email notifications and webhook notifications into separate howtos * Updates re: review @ericholscher * More review feedback addressed * Update several parts of copy to adapt to the split * Dot the i's * Adds a note about PR notifications being skipped * prefer "documentation builds" * Trim out a seealso to give the other two more prominence
1 parent 255d7ee commit e2c3400

File tree

5 files changed

+158
-123
lines changed

5 files changed

+158
-123
lines changed

docs/user/build-notifications.rst

+17-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
Build Notifications and Webhooks
2-
================================
1+
Build notifications via webhooks and email
2+
==========================================
33

4-
Read the Docs features a number of build notification mechanisms.
5-
Build notifications can alert you when your builds fail so you can take immediate action.
4+
Build notifications can alert you when your documentation builds fail so you can take immediate action.
5+
We offer the following methods for being notified:
66

77
Email notifications:
8-
Read the Docs allows you to configure emails that can be sent on failing builds.
9-
This makes sure you know when your builds have failed.
8+
Read the Docs allows you to configure build notifications via email.
9+
When builds fail,
10+
configured email addresses are notified.
1011

1112
Build Status Webhooks:
1213
Build notifications can happen via :term:`webhooks <webhook>`.
@@ -16,9 +17,15 @@ Build Status Webhooks:
1617

1718
Webhooks can be customized through your own template and a variety of variable substitutions.
1819

20+
.. note::
21+
22+
We don't trigger email notifications or build status webhooks on :doc:`builds from pull requests </pull-requests>`.
23+
1924
.. seealso::
20-
:doc:`/guides/build-notifications`
21-
All the practical steps for setting up build notifications
25+
:doc:`/guides/build/email-notifications`
26+
Enable email notifications on failed builds,
27+
so you always know that your docs are deploying successfully.
2228

23-
:doc:`pull-requests`
24-
Similarly to build notifications, you can also configure automated feedback for your pull requests.
29+
:doc:`/guides/build/webhooks`
30+
Steps for setting up build notifications via webhooks,
31+
including examples for popular platforms like Slack and Discord.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
How to setup email notifications
2+
================================
3+
4+
In this brief guide,
5+
you can learn how to setup a simple build notification via email.
6+
7+
Read the Docs allows you to configure emails that will be notified on failing builds.
8+
This makes sure that you are aware of failures happening in an otherwise automated process.
9+
10+
.. seealso::
11+
12+
:doc:`/guides/build/webhooks`
13+
How to use webhooks to be notified about builds on popular platforms like Slack and Discord.
14+
15+
:doc:`/pull-requests`
16+
Configure automated feedback and documentation site previews for your pull requests.
17+
18+
19+
Email notifications
20+
-------------------
21+
22+
Follow these steps to add an email address to be notified about build failures:
23+
24+
* Go to :menuselection:`Admin --> Notifications` in your project.
25+
* Fill in the **Email** field under the **New Email Notifications** heading
26+
* Press :guilabel:`Add` and the email is saved and will be displayed in the list of **Existing notifications**.
27+
28+
The newly added email address will be notified once a build fails.
29+
30+
31+
.. note::
32+
33+
We don't send email notifications on :doc:`builds from pull requests </pull-requests>`.

docs/user/guides/build/index.rst

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
How-to guides: build process
22
============================
33

4-
⏩️ :doc:`Setup build notifications and webhooks </guides/build-notifications>`
5-
Build notifications can alert you when your builds fail so you can take immediate action.
6-
In this guide,
7-
you will learn how to get notified through various available channel integrations,
8-
including email and chat.
4+
⏩️ :doc:`Setup email notifications </guides/build/email-notifications>`
5+
Email notifications can alert you when your builds fail.
6+
This is the most simple way to monitor your documentation builds,
7+
it only requires you to switch it on.
8+
9+
⏩️ :doc:`Setup webhook notifications </guides/build/webhooks>`
10+
Webhook notifications can alert you when your builds fail so you can take immediate action.
11+
We show examples of how to use the webhooks on popular platforms like Slack and Discord.
912

1013
⏩️ :doc:`Configuring pull request builds </guides/pull-requests>`
1114
Have your documentation built and access a preview for every :doc:`pull request builds </pull-requests>`.
@@ -28,7 +31,8 @@ How-to guides: build process
2831
:maxdepth: 1
2932
:hidden:
3033

31-
Setup build notifications and webhooks </guides/build-notifications>
34+
Setup email notifications </guides/build/email-notifications>
35+
Setup webhook notifications </guides/build/webhooks>
3236
Configuring pull request builds </guides/pull-requests>
3337
Using custom environment variables </guides/environment-variables>
3438
Managing versions automatically </guides/automation-rules>

docs/user/guides/build-notifications.rst renamed to docs/user/guides/build/webhooks.rst

+93-105
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,29 @@
1-
How to setup build notifications and webhooks
2-
=============================================
1+
How to setup build status webhooks
2+
==================================
33

4-
In this guide, you can learn how to setup a number of build notification mechanisms.
5-
Build notifications can alert you when your builds fail so you can take immediate action.
4+
In this guide,
5+
you can learn how to setup build notifications via webhooks.
66

7-
.. note::
7+
When a documentation build is *triggered*, *successful* or *failed*,
8+
Read the Docs can notify external APIs using :term:`webhooks <webhook>`.
9+
In that way,
10+
you can receive build notifications in your own monitoring channels and be alerted you when your builds fail so you can take immediate action.
811

9-
Currently we don't send notifications or trigger :term:`webhooks <webhook>`
10-
on :doc:`builds from pull requests </pull-requests>`.
12+
.. seealso::
1113

14+
:doc:`/guides/build/email-notifications`
15+
Setup basic email notifications for build failures.
1216

13-
.. tip::
1417
:doc:`/pull-requests`
15-
Similarly to build notifications, you can also configure automated feedback for your pull requests.
16-
17-
18-
.. contents:: Contents
19-
:local:
20-
21-
22-
Email notifications
23-
-------------------
24-
25-
Read the Docs allows you to configure emails that can be sent on failing builds.
26-
This makes sure you know when your builds have failed.
27-
28-
Take these steps to enable build notifications using email:
18+
Configure automated feedback and documentation site previews for your pull requests.
2919

30-
* Go to :guilabel:`Admin` > :guilabel:`Notifications` in your project.
31-
* Fill in the **Email** field under the **New Email Notifications** heading
32-
* Submit the form
33-
34-
You should now get notified by email when your builds fail!
3520

3621
Build status webhooks
3722
---------------------
3823

39-
Read the Docs can also send webhooks when builds are triggered, successful or failed.
40-
4124
Take these steps to enable build notifications using a webhook:
4225

43-
* Go to :guilabel:`Admin` > :guilabel:`Webhooks` in your project.
26+
* Go to :menuselection:`Admin --> Webhooks` in your project.
4427
* Fill in the **URL** field and select what events will trigger the webhook
4528
* Modify the payload or leave the default (see below)
4629
* Click on :guilabel:`Save`
@@ -79,6 +62,11 @@ you will see the server response, the webhook request, and the payload.
7962

8063
Activity of a webhook
8164

65+
.. note::
66+
67+
We don't trigger :term:`webhooks <webhook>` on :doc:`builds from pull requests </pull-requests>`.
68+
69+
8270
Custom payload examples
8371
~~~~~~~~~~~~~~~~~~~~~~~
8472

@@ -93,81 +81,81 @@ and in the following section you will find all the available variables.
9381

9482
Custom payload
9583

96-
Slack
97-
+++++
98-
99-
.. code-block:: json
100-
101-
{
102-
"attachments": [
103-
{
104-
"color": "#db3238",
105-
"blocks": [
106-
{
107-
"type": "section",
108-
"text": {
109-
"type": "mrkdwn",
110-
"text": "*Read the Docs build failed*"
84+
.. tabs::
85+
86+
.. tab:: Slack
87+
88+
.. code-block:: json
89+
90+
{
91+
"attachments": [
92+
{
93+
"color": "#db3238",
94+
"blocks": [
95+
{
96+
"type": "section",
97+
"text": {
98+
"type": "mrkdwn",
99+
"text": "*Read the Docs build failed*"
100+
}
101+
},
102+
{
103+
"type": "section",
104+
"fields": [
105+
{
106+
"type": "mrkdwn",
107+
"text": "*Project*: <{{ project.url }}|{{ project.name }}>"
108+
},
109+
{
110+
"type": "mrkdwn",
111+
"text": "*Version*: {{ version.name }} ({{ build.commit }})"
112+
},
113+
{
114+
"type": "mrkdwn",
115+
"text": "*Build*: <{{ build.url }}|{{ build.id }}>"
116+
}
117+
]
118+
}
119+
]
111120
}
112-
},
113-
{
114-
"type": "section",
115-
"fields": [
116-
{
117-
"type": "mrkdwn",
118-
"text": "*Project*: <{{ project.url }}|{{ project.name }}>"
119-
},
120-
{
121-
"type": "mrkdwn",
122-
"text": "*Version*: {{ version.name }} ({{ build.commit }})"
123-
},
124-
{
125-
"type": "mrkdwn",
126-
"text": "*Build*: <{{ build.url }}|{{ build.id }}>"
127-
}
128-
]
129-
}
130-
]
131-
}
132-
]
133-
}
134-
135-
More information on `the Slack Incoming Webhooks documentation <https://api.slack.com/messaging/webhooks>`_.
136-
137-
Discord
138-
+++++++
139-
140-
.. code-block:: json
141-
142-
{
143-
"username": "Read the Docs",
144-
"content": "Read the Docs build failed",
145-
"embeds": [
146-
{
147-
"title": "Build logs",
148-
"url": "{{ build.url }}",
149-
"color": 15258703,
150-
"fields": [
151-
{
152-
"name": "*Project*",
153-
"value": "{{ project.url }}",
154-
"inline": true
155-
},
156-
{
157-
"name": "*Version*",
158-
"value": "{{ version.name }} ({{ build.commit }})",
159-
"inline": true
160-
},
161-
{
162-
"name": "*Build*",
163-
"value": "{{ build.url }}"
164-
}
165-
]
166-
}
167-
]
168-
}
121+
]
122+
}
123+
124+
More information on `the Slack Incoming Webhooks documentation <https://api.slack.com/messaging/webhooks>`_.
125+
126+
.. tab:: Discord
127+
128+
.. code-block:: json
129+
130+
{
131+
"username": "Read the Docs",
132+
"content": "Read the Docs build failed",
133+
"embeds": [
134+
{
135+
"title": "Build logs",
136+
"url": "{{ build.url }}",
137+
"color": 15258703,
138+
"fields": [
139+
{
140+
"name": "*Project*",
141+
"value": "{{ project.url }}",
142+
"inline": true
143+
},
144+
{
145+
"name": "*Version*",
146+
"value": "{{ version.name }} ({{ build.commit }})",
147+
"inline": true
148+
},
149+
{
150+
"name": "*Build*",
151+
"value": "{{ build.url }}"
152+
}
153+
]
154+
}
155+
]
156+
}
169157
170-
More information on `the Discord webhooks documentation <https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks>`_.
158+
More information on `the Discord webhooks documentation <https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks>`_.
171159

172160
Variable substitutions reference
173161
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -213,7 +201,7 @@ Variable substitutions reference
213201
Version name.
214202

215203
Validating the payload
216-
~~~~~~~~~~~~~~~~~~~~~~
204+
----------------------
217205

218206
After you add a new webhook, Read the Docs will generate a secret key for it
219207
and uses it to generate a hash signature (HMAC-SHA256) for each payload
@@ -255,7 +243,7 @@ like this:
255243
)
256244
257245
Legacy webhooks
258-
~~~~~~~~~~~~~~~
246+
---------------
259247

260248
Webhooks created before the custom payloads functionality was added to Read the Docs
261249
send a payload with the following structure:

docs/user/guides/setup/git-repo-manual.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,11 @@ Use this URL when setting up a new integration with your provider ^^ these steps
139139

140140
.. seealso::
141141

142-
:doc:`/guides/build-notifications`
143-
Learn how to add custom build notifications.
142+
:doc:`/guides/build/email-notifications`
143+
Quickly enable email notifications.
144+
145+
:doc:`/guides/build/webhooks`
146+
Learn how to add custom webhook notifications.
144147

145148

146149
.. _webhook-integration-generic:

0 commit comments

Comments
 (0)