-
Notifications
You must be signed in to change notification settings - Fork 3
Prerequisites SendGrid
amccook edited this page Aug 17, 2023
·
7 revisions
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
If you don't already have one, configure a SendGrid account. This can be done via IBM Cloud or via SendGrid. In these instructions we'll setup SendGrid via IBM Cloud and use the free tier which allows you send 3000 emails/month.
- Login to IBM Cloud and navigate to: https://cloud.ibm.com/catalog/infrastructure/email-delivery
- Click
Create. - Provide an email address and choose the Free Package. Click
Create.
- From the
Email Deliverypage, click theVendor Portallink to login to your SendGrid account.
- In the SendGrid portal, go to
Email API>Integration Guide>Web API>Choose
- When asked to "Choose the language you want to use," locate
cURLand selectChoose
- In section 2, provide a name for your API Key. Click
Create Key
- Record your API key for use later on.
- To verify your SendGrid API is working, follow instructions in section 4 to
Run the code. Then clickNext: Verify Integration
- Go to
Email API>Dynamic Templates>Create a Dynamic Template
- Provide a name for your template. In this example, name it
TurboResizeEmail> ClickCreate
- Locate the template you just created and click
Add Version
- Hover over
Blank Templateand clickSelect
- Locate
Design Editorand clickSelect
- In the Dynamic Version Settings, provide a Version Name. In the
Subjectfield, write:Turbonomic: VM Resize Notification - {{displayName}}
- Click on the
Buildtab and click/drag theTextbox onto the template page.
- 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}}
- At the top, click
Save. And click back arrow at the top to return to theDynamic Templatespage. - 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>
- Lastly, to complete the SendGrid setup, navigate to
Settings>Sender Authentication> Click theVerify a Single Senderbutton. 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>
- You can now test the example by adding the
On-Prem VM Resizeaction webhook to Turbonomic.