Skip to content
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

SendGrid readme #11850

Merged
merged 1 commit into from
May 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions components/sendgrid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,55 @@ The Twilio SendGrid API opens up a world of possibilities for email automation,
- **Email Campaign Stats to Google Sheets**: After sending an email campaign through SendGrid, you may want to analyze the performance data. Pipedream can automatically fetch the stats, like opens, clicks, and bounces, and log them into a Google Sheet for easy tracking and visualization.

- **E-commerce Order Confirmation and Follow-up**: When a new order is received in an e-commerce platform like Shopify, you can use Pipedream to trigger an order confirmation email via SendGrid. After a set period, you can follow up with another email asking for feedback or offering a discount on future purchases.

# Getting Started

First, open the SendGrid console and log in.

Then open the [Integration Guide](https://app.sendgrid.com/guide/integrate) and select the **Web API** option.

![Open the Twilio SendGrid Integration Guide to begin the process of creating an API key to connect with Pipedream](https://res.cloudinary.com/pipedreamin/image/upload/v1715176223/marketplace/apps/sendgrid/CleanShot_2024-05-07_at_15.17.56_2x_zhynua.png)

Then choose any language from the next menu. Choose any programming language; this selection only affects the example code shown. The key step is obtaining the API key.

After picking a language, you'll be prompted to generate an API key, we recommend naming it `Pipedream` for easy identification.

![Name the API key "pipedream" and then after clicking the Generate button, copy the API key and paste it into Pipedream](https://res.cloudinary.com/pipedreamin/image/upload/v1715176222/marketplace/apps/sendgrid/CleanShot_2024-05-07_at_15.19.44_2x_hcduuf.png)

After creating the API key, copy it and paste it into the appropriate configuration field in a Pipedream SendGrid connected account, either through a Pipedream action/trigger or through the Connected Accounts section of the dashboard.

You can skip the remaining steps of the Integration guide that test your API key, as these are not necessary for the integration with Pipedream.

# Troubleshooting

SendGrid uses standard HTTP status codes to help troubleshoot issues.

If a SendGrid API call fails, Pipedream will show the error code which you can match with below:

## 400 - Bad Request

This error is shown when the request is missing data or is malformed. An example is a malformed email address; SendGrid won't accept invalid email addresses to deliver mail.

## 401 - Unauthorized

This means that your SendGrid API key connected to Pipedream is invalid or is missing from the request.

Ensure the API key is copied correctly from your SendGrid console and included properly as an `Authorization` header in the format `Bearer ${your token here}`.

## 403 - Sender email isn't verified

This error occurs when you attempt to use an unverified sender email address under your account. To resolve this error, use the correct email address or verify the email address. See the [verification requirements here](https://docs.sendgrid.com/for-developers/sending-email/sender-identity/).

## 406 - Missing Accept header

Make sure to pass `Accept: application/json` in the headers of your HTTP request in order for SendGrid to process your request correctly.

## 429 - Rate Limit

This error is thrown when you're sending too many API requests in a short window. The `X-RateLimit-Remaining` and `X-RateLimit-Reset` headers in the response give you the amount of requests remaining in the current rate limit window.

You can use [Concurrency and Throttling](https://pipedream.com/docs/workflows/concurrency-and-throttling) in your workflow to throttle how quickly your workflow processes new events.

## 500 - Internal Server Error

This means that SendGrid is having issues processing requests; check their [status page](https://status.sendgrid.com/) for updates on the service. For these issues, contact SendGrid directly.
Loading