For this tutorial, you will need to have access to a web server that supports PHP.
- Save one of the PHP files listed here: https://gist.github.com/eurica/6034108.
- Modify the email address listed to the address that you’d like to get emails for all incident status changes within your text editor:
$emailAddress = "CHANGEME@example.com";.
- Upload the PHP file to your web server.
- Log in to your PagerDuty account.
- Go to Configuration → Services and select the service that you’d like to get notified about on incident updates.
- By default, you will be directed to the Incidents tab of the service’s individual page. To add a webhook, switch over to the Integrations tab.
- Click New Extension.
- For the Extension Type select Generic Webhook, then enter a name for your webhook, paste the URL to the PHP script that you uploaded, and click Save.
Now when an incident’s state changes, you will get an email notification. You can customize the script to format the data to your liking. By default it will tell you the incident status, subject, and service, along with a link to the incident. The full JSON payload is sent with the message.