Skip to content

Prerequisites SendGrid

amccook edited this page Sep 7, 2023 · 7 revisions

Introduction

In order to use Turbonomic Webhooks with SendGrid, the following prerequisites must be configured. This outlines the bare-minimum steps required to integrate Turbonomic Webhooks with SendGrid. For more advanced usage of SendGrid, please refer to their docs.

  • Create a SendGrid Account
  • Generate your SendGrid API key
  • Create a Dynamic Template

1. Create a SendGrid Account

If you don't already have one, configure a SendGrid account. SendGrid offers a Free Plan which allows you to send 3000 emails/month.

  1. Navigate to https://sendgrid.com/
  2. Click Start for free in the top right corner.
  3. Follow the prompts to create a Free account.

2. Generate your SendGrid API key

  1. In the SendGrid portal, go to Email API > Integration Guide > Web API > Choose
  2. When asked to "Choose the language you want to use," locate cURL and select Choose
  3. In section 2, provide a name for your API Key. Click Create Key
  4. Record your API key for use later on.
  5. To verify your SendGrid API is working, follow instructions in section 4 to Run the code. Then click Next: Verify Integration

3. Create a Dynamic Template

  1. Go to Email API > Dynamic Templates > Create a Dynamic Template
  2. Provide a name for your template. In this example, name it TurboResizeEmail > Click Create
  3. Locate the template you just created and click Add Version
  4. Hover over Blank Template and click Select
  5. Locate Design Editor and click Select
  6. In the Dynamic Version Settings, provide a Version Name. In the Subject field, write: Turbonomic: VM Resize Notification - {{displayName}}
  7. Click on the Build tab and click/drag the Text box onto the template page.
  8. Paste the following text into the text box. This is an example template for executing On-Prem VM Resize actions in Turbonomic.
    Your VM, {{displayName}}, has been resized from {{currentValue}} {{valueUnits}} to {{newValue}} {{valueUnits}}. You can review its utilization here: https://{{turboUrl}}/app/index.html#/view/main/{{uuid}}/details
    
    Details:
      - Status: {{actionState}} via {{actionMode}} by {{userName}} at {{updateTime}}
      - Instance: {{displayName}}
      - Details: {{details}}
      - Reason: {{risk_subCategory}}
      - Commodity: {{risk_reasonCommodities}}
    

  9. At the top, click Save. And click back arrow at the top to return to the Dynamic Templates page.
  10. Expand the template, and make note of the Template ID. You will use this Template ID in the Turbonomic Webhook wherever you see the variable <SENDGRID_DYNAMIC_TEMPLATE_ID>
  11. Lastly, to complete the SendGrid setup, navigate to Settings > Sender Authentication > Click the Verify a Single Sender button. This will verify ownership of a single email address to use as a sender in the Turbonomic webhook wherever you see the variable <FROM_EMAIL_ADDRESS>
  12. You can now test the example by adding the On-Prem VM Resize action webhook to Turbonomic.