Trigger Incidents via SMS with Google Voice & Gmail


(Jonathan Curry) #1

If you would like to manually trigger a PagerDuty incident via SMS, Google Voice has an SMS forwarding option which forwards all text messages to your Gmail address, which can then be forwarded to a PagerDuty integration email address.

  1. Create a Google Voice Email Integration
    Follow the steps to create a generic email service, but choose Google Voice from the integrations list instead of Integrate via Email, then copy the integration email address for use in Google Voice.

  2. Set Up a Google Voice Account
    Log in to Google Voice at If you’ve never used Google Voice before, follow the steps to set up a new phone number and complete Google’s verification process.

  3. Enable Text Forwarding
    Go to :gear: Settings and enable Forward messages to email under the Messages section.

  4. Configure Forwarding in Gmail
    To make sure that only the SMS’s sent to your Google Voice provided phone number (and not every email received to your Gmail account) trigger an incident, you must set up filters for forwarding:

    1. Send a test SMS to your Google Voice number.
    2. After you receive the test message in your Gmail inbox, open the message and click the More button, click Filter messages like these, then click Create filter with this search to create a filter that matches the From address.
    3. Select the Forward it option and select your forwarding address from the drop-down list (this will be the integration email you created in PagerDuty in step 1).
    4. Make sure that the forwarding email has in use by filter so that only messages sent to your Google Voice number will be forwarded to your integration email.
    5. Click Create filter.
  5. Test It!
    Send an SMS message to your Google Voice number and confirm that a triggered incident has reached your PagerDuty account.

(David Hayes) #2

If you have a Twilio account you can also parse their webhooks with a Custom Event Transformer and this code:

var contexts = [{
  "type": "link",
  "href": "tel:" + PD.inputRequest.body.From,
  "text": "call " + PD.inputRequest.body.From

if (PD.inputRequest.body.MediaUrl0) {
    "type": "image",
    "src": PD.inputRequest.body.MediaUrl0

var normalized_event = {
  incident_key: PD.inputRequest.body.SmsMessageSid,
  event_type: PD.Trigger,
  description: PD.inputRequest.body.From + " " + PD.inputRequest.body.Body,
  contexts: contexts


(system) #3