-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Docs: Split email notifications and webhook notifications into separate howtos #10396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
20c7e66
5ddd445
fea3fc6
e60ca66
33b3b9c
8df4c44
1454899
3368ed9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
How to enable email notifications | ||
================================= | ||
benjaoming marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
In this guide, you can learn how to setup build notification via email. | ||
|
||
.. note:: | ||
|
||
Currently we don't send email notifications on :doc:`builds from pull requests </pull-requests>`. | ||
benjaoming marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
.. tip:: | ||
:doc:`/pull-requests` | ||
Similarly to email notifications, | ||
you can also configure automated feedback for your pull requests. | ||
|
||
|
||
benjaoming marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Email notifications | ||
------------------- | ||
|
||
Read the Docs allows you to configure emails that can be sent on failing builds. | ||
This makes sure you know when your builds have failed. | ||
|
||
Take these steps to enable build notifications using email: | ||
|
||
* Go to :menuselection:`Admin --> Notifications` in your project. | ||
* Fill in the **Email** field under the **New Email Notifications** heading | ||
* Submit the form | ||
|
||
Who is notified? | ||
---------------- | ||
|
||
If you are a single owner of a project, | ||
*you* will get notified. | ||
|
||
If your project has several members, | ||
then the following are notified: | ||
|
||
* All :term:`maintainers <maintainer>` (|org_brand|) | ||
* All owners of an :doc:`organization </commercial/organizations>` (|com_brand|) | ||
that owns the project, | ||
or members of teams with admin access to the project. | ||
benjaoming marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,18 @@ | ||
How to setup build notifications and webhooks | ||
============================================= | ||
How to setup webhook notifications | ||
================================== | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we should be systematic about calling the feature "build status webhooks" since that's how it is right now. If we're gonna do anything more drastic, I think it should include the Dashboard terminology, so I would just save that for later.. |
||
|
||
In this guide, you can learn how to setup a number of build notification mechanisms. | ||
In this guide, you can learn how to setup build notification with webhooks. | ||
Build notifications can alert you when your builds fail so you can take immediate action. | ||
|
||
.. note:: | ||
|
||
Currently we don't send notifications or trigger :term:`webhooks <webhook>` | ||
on :doc:`builds from pull requests </pull-requests>`. | ||
Currently we don't trigger :term:`webhooks <webhook>` on :doc:`builds from pull requests </pull-requests>`. | ||
|
||
|
||
.. tip:: | ||
:doc:`/pull-requests` | ||
Similarly to build notifications, you can also configure automated feedback for your pull requests. | ||
|
||
|
||
.. contents:: Contents | ||
:local: | ||
|
||
|
||
Email notifications | ||
------------------- | ||
|
||
Read the Docs allows you to configure emails that can be sent on failing builds. | ||
This makes sure you know when your builds have failed. | ||
|
||
Take these steps to enable build notifications using email: | ||
|
||
* Go to :guilabel:`Admin` > :guilabel:`Notifications` in your project. | ||
* Fill in the **Email** field under the **New Email Notifications** heading | ||
* Submit the form | ||
|
||
You should now get notified by email when your builds fail! | ||
Similarly to webhook notifications, | ||
benjaoming marked this conversation as resolved.
Show resolved
Hide resolved
|
||
you can also configure automated feedback for your pull requests. | ||
|
||
Build status webhooks | ||
--------------------- | ||
|
@@ -40,7 +21,7 @@ Read the Docs can also send webhooks when builds are triggered, successful or fa | |
|
||
Take these steps to enable build notifications using a webhook: | ||
|
||
* Go to :guilabel:`Admin` > :guilabel:`Webhooks` in your project. | ||
* Go to :menuselection:`Admin --> Webhooks` in your project. | ||
* Fill in the **URL** field and select what events will trigger the webhook | ||
* Modify the payload or leave the default (see below) | ||
* Click on :guilabel:`Save` | ||
|
@@ -80,7 +61,7 @@ you will see the server response, the webhook request, and the payload. | |
Activity of a webhook | ||
|
||
Custom payload examples | ||
~~~~~~~~~~~~~~~~~~~~~~~ | ||
----------------------- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we shouldn't change these here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I reverted it 👍 But essentially, it's because I wanted to go towards a step-wise how-to (and not nested sections like we have in reference or explanation). Unfortunately, this how-to is very far from such a result :) In general, how-tos are better like....
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following two were not updated and they should because of the same reason. I understand what you want to achieve with the sections, but this case doesn't work like that since they are subsections and not steps the user has to follow. |
||
|
||
You can customize the payload of the webhook to suit your needs, | ||
as long as it is valid JSON. Below you have a couple of examples, | ||
|
@@ -93,84 +74,84 @@ and in the following section you will find all the available variables. | |
|
||
Custom payload | ||
|
||
Slack | ||
+++++ | ||
|
||
.. code-block:: json | ||
|
||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#db3238", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*Read the Docs build failed*" | ||
.. tabs:: | ||
|
||
.. tab:: Slack | ||
|
||
.. code-block:: json | ||
|
||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#db3238", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*Read the Docs build failed*" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Project*: <{{ project.url }}|{{ project.name }}>" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Version*: {{ version.name }} ({{ build.commit }})" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Build*: <{{ build.url }}|{{ build.id }}>" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Project*: <{{ project.url }}|{{ project.name }}>" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Version*: {{ version.name }} ({{ build.commit }})" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Build*: <{{ build.url }}|{{ build.id }}>" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
More information on `the Slack Incoming Webhooks documentation <https://api.slack.com/messaging/webhooks>`_. | ||
|
||
Discord | ||
+++++++ | ||
|
||
.. code-block:: json | ||
|
||
{ | ||
"username": "Read the Docs", | ||
"content": "Read the Docs build failed", | ||
"embeds": [ | ||
{ | ||
"title": "Build logs", | ||
"url": "{{ build.url }}", | ||
"color": 15258703, | ||
"fields": [ | ||
{ | ||
"name": "*Project*", | ||
"value": "{{ project.url }}", | ||
"inline": true | ||
}, | ||
{ | ||
"name": "*Version*", | ||
"value": "{{ version.name }} ({{ build.commit }})", | ||
"inline": true | ||
}, | ||
{ | ||
"name": "*Build*", | ||
"value": "{{ build.url }}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
More information on `the Slack Incoming Webhooks documentation <https://api.slack.com/messaging/webhooks>`_. | ||
|
||
.. tab:: Discord | ||
|
||
.. code-block:: json | ||
|
||
{ | ||
"username": "Read the Docs", | ||
"content": "Read the Docs build failed", | ||
"embeds": [ | ||
{ | ||
"title": "Build logs", | ||
"url": "{{ build.url }}", | ||
"color": 15258703, | ||
"fields": [ | ||
{ | ||
"name": "*Project*", | ||
"value": "{{ project.url }}", | ||
"inline": true | ||
}, | ||
{ | ||
"name": "*Version*", | ||
"value": "{{ version.name }} ({{ build.commit }})", | ||
"inline": true | ||
}, | ||
{ | ||
"name": "*Build*", | ||
"value": "{{ build.url }}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
More information on `the Discord webhooks documentation <https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks>`_. | ||
More information on `the Discord webhooks documentation <https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks>`_. | ||
|
||
Variable substitutions reference | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
-------------------------------- | ||
|
||
``{{ event }}`` | ||
Event that triggered the webhook, one of ``build:triggered``, ``build:failed``, or ``build:passed``. | ||
|
@@ -213,7 +194,7 @@ Variable substitutions reference | |
Version name. | ||
|
||
Validating the payload | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
---------------------- | ||
|
||
After you add a new webhook, Read the Docs will generate a secret key for it | ||
and uses it to generate a hash signature (HMAC-SHA256) for each payload | ||
|
@@ -255,7 +236,7 @@ like this: | |
) | ||
|
||
Legacy webhooks | ||
~~~~~~~~~~~~~~~ | ||
--------------- | ||
|
||
Webhooks created before the custom payloads functionality was added to Read the Docs | ||
send a payload with the following structure: | ||
|
Uh oh!
There was an error while loading. Please reload this page.