Skip to content

Commit 99922b5

Browse files
authored
Update configure-environment-variables.mdx
Signed-off-by: fulleni <[email protected]>
1 parent 5326bce commit 99922b5

File tree

1 file changed

+39
-9
lines changed

1 file changed

+39
-9
lines changed

src/content/docs/api-server/guides/configure-environment-variables.mdx

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,53 @@ A long, random password used to secure your API.
4545
Your API key for the SendGrid service, which is used to send transactional emails like One-Time Passwords (OTPs).
4646

4747
- **How to Obtain:**
48-
1. Create a [SendGrid account](https://signup.sendgrid.com/).
49-
2. Navigate to **Settings > API Keys** in your SendGrid dashboard.
50-
3. Create a new API key with "Full Access" or restricted permissions for sending mail.
51-
4. Copy the generated key and paste it here.
48+
1. create a free [SendGrid account](https://signup.sendgrid.com/).
49+
2. create your API key, follow the [official SendGrid guide](https://www.twilio.com/docs/sendgrid/ui/account-and-settings/api-keys#creating-an-api-key).
50+
3. Copy the generated key and paste it here.
5251

5352
#### `DEFAULT_SENDER_EMAIL`
5453
The email address that will appear as the sender for all transactional emails. This should be an email address you have verified with SendGrid.
5554

55+
<Aside type="caution">
56+
SendGrid requires you to prove you own this email address to prevent it from rejecting your emails. This is done through a process called "Single Sender Verification".
57+
</Aside>
58+
59+
**How to Verify:** Follow the [official SendGrid guide](https://www.twilio.com/docs/sendgrid/ui/sending-email/sender-verification). You will need to click a confirmation link sent to that address.
60+
61+
5662
#### `OTP_TEMPLATE_ID`
5763
The ID of the dynamic email template in SendGrid used for sending OTP codes.
5864

59-
- **How to Obtain:**
60-
1. In your SendGrid dashboard, go to **Email API > Dynamic Templates**.
61-
2. Create a new template. The template must include a variable for the code (e.g., `{{otp_code}}`).
62-
3. Copy the Template ID and paste it here.
65+
- **Steps to Create the Template:**
6366

64-
---
67+
1. Go directly to SendGrid's [**Dynamic Templates page**](https://mc.sendgrid.com/dynamic-templates).
68+
69+
2. Click "**Create a Dynamic Template**" and give it a name (e.g., "OTP Template").
70+
71+
3. Click your new template, then click "**Add Version**" and choose the "Blank Template" then the "**Code Editor**".
72+
73+
4. Empty all existing HTML code then paste the code below. It includes the required `{{otp_code}}` placeholder.
74+
75+
76+
```html
77+
<!DOCTYPE html>
78+
<html>
79+
<head>
80+
<title>Your One-Time Password</title>
81+
</head>
82+
<body style="font-family: sans-serif; text-align: center; padding: 40px;">
83+
<div style="max-width: 600px; margin: auto; border: 1px solid #ddd; padding: 20px; border-radius: 8px;">
84+
<h2 style="color: #333;">Your One-Time Password</h2>
85+
<p style="color: #555;">Use the code below to complete your sign-in.</p>
86+
<div style="font-size: 36px; font-weight: bold; letter-spacing: 5px; margin: 20px 0; padding: 15px; background-color: #f5f5f5; border-radius: 5px;">
87+
{{otp_code}}
88+
</div>
89+
<p style="color: #888; font-size: 12px;">This code will expire in 10 minutes. If you did not request this, please ignore this email.</p>
90+
</div>
91+
</body>
92+
</html>
93+
```
94+
5. **Save the template**. Go back to the main Dynamic Templates page and copy the **Template ID**. You will need this ID for your server configuration.
6595

6696
### Optional Variables
6797

0 commit comments

Comments
 (0)