> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shipthing.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SendGrid

> Learn how to use SendGrid for sending emails.

To use SendGrid with ShipThing

**1. Create a SendGrid account**

[Create a SendGrid account](https://login.twilio.com/u/signup) and grab your API key.

**2. Add environment variables**

Add the `SENDGIRD_TOKEN` environment variables to your .env.local file and your deployment environment:

Then, make sure to activate SendGrid:

```ts /packages/email/index.ts theme={"system"}
export * from './providers/sendgrid';
```

**3. Sending Emails**

```tsx apps/web/app/contact/actions/contact.tsx theme={"system"}
import { sendgridClient } from '@repo/email';
import { ContactTemplate } from '@repo/email/emails/contact';
import { render } from "@react-email/components";

const emailHtml = await render(<ContactTemplate name={name} email={email} message={message} />);

await sendgridClient.send({
    from: 'sender@acme.com',
    to: 'recipient@acme.com',
    subject: 'The email subject',
    react: emailHtml,
});
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.