Skip to content

Latest commit

 

History

History

database-email-update

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Sample Integration: Notion to Email

drawing

About the Integration

This Notion integration sends an email whenever the Status of a page in a database is updated.

This sample was built using this database template and emails are sent using SendGrid's API.

1. Setup your local project

# Clone this repository locally
git clone https://github.com/makenotion/notion-sdk-js.git

# Switch into this project
cd notion-sdk-js/examples/database-update-send-email

# Install the dependencies
npm install

2. Setup a free account at SendGrid

Sign up for a free account and follow the instructions to use the Email API.

Choose the option for integrating with the Web API and follow instructions to get your API token.

Running Locally

3. Setup your Notion workspace

You can create your Notion API key here.

To create a Notion database that will work with this example, duplicate this database template.

Your Notion integration will need access to the Notion database you have created. To provide access, follow the instructions found in Notion's Integration guide.

4. Set your environment variables to a .env file

Rename example.env to .env in this directory and add the following fields:

NOTION_KEY=<your-notion-api-key>
SENDGRID_KEY=<your-sendgrid-api-key>
NOTION_DATABASE_ID=<your-notion-database-id>
EMAIL_TO_FIELD=<email-recipients>
EMAIL_FROM_FIELD=<email-from-field>

5. Run code

npm run ts-run