Ishaan
Jan 21, 2023
# Using SendGrid for E-Mail Communication
#### Generate API Key, Goto Settings > API keys
![](https://storage-for-tutors.ams3.digitaloceanspaces.com/helpdesk/tenant/651456610067eba9d6188aac/content/image/sg_keys.png)
#### **Restricted** Key can be generated with "**Full Access**" to "**Mail Send**"\\
![](https://storage-for-tutors.ams3.digitaloceanspaces.com/helpdesk/tenant/651456610067eba9d6188aac/content/image/sg_permissionskeys.png)
#### Copy the generated key
**Now create Dynamic Templates for the 3 basic email types**
* Invitation
* E-Mail Verification
* Forgot Password
![](https://storage-for-tutors.ams3.digitaloceanspaces.com/helpdesk/tenant/651456610067eba9d6188aac/content/image/sg_dynamic%20templates.png)
#### For Local, Update the Template ID's in .env file
#### For Server, Add Environment Variables as
```js
SENDGRID_EMAIL_FROM = "no-reply@baryonventures.com"
SENDGRID_KEY = "SG.bc7c5WYzQ6OxLuC0mtk8sA.XXXXXXXXXXXXXXXXXXXXXXyhIkjxVMO9uMJsWOkNgE0"
SENDGRID_TEMPLATE_EMAIL_ADDRESS_VERIFICATION = "d-e3e06979b26d44XXXXXXXXXXXea42a"
SENDGRID_TEMPLATE_INVITATION = "d-485b1XXXXXXXXXXXXX6ed2c69e6ab1"
SENDGRID_TEMPLATE_PASSWORD_RESET = "d-57f6eXXXXXXXXXXXXXXX7cf11c25b"
```