🔐Creating env variables
Steps to create the environment variables needed for the functioning of the contact form and the backend edge function.
Last updated
Steps to create the environment variables needed for the functioning of the contact form and the backend edge function.
Last updated
The contact page on the website is connected to an edge function that requires three env variables - NOTION_API_KEY, NOTION_DB_ID, NOTION_USER_ID to store the contact enquiries and notify you about the enquiries.
Follow the steps below to create the env variables and then paste them in your deployment settings as described in the deployment documentation.
Go to https://notion.so
Create your account by clicking on Get Notion free.
Navigate to https://developers.notion.com/ and login with your notion account.
Click “View my integrations”.
Click “New integration”
Give the integration a name of your choice.
Click submit.
Click “Capabilities”
Click “Read user information without email addresses”
Click “Save changes”
Go back to “Secrets”
Click on “Show” and then “Copy”
This secret is your NOTION_API_KEY value. Paste it in your deployment environment variables.
Go to https://notion.so and login with your Notion account.
Create a new page, with a table.
Create a new data source by entering the name and clicking on new database in the next page as shown below.
Change the heading of the 'Name' column to 'Subject'. This is the title column for the new pages.
Delete the Tags column.
The final table should look similar to the below table.
Click on more and then Add Connections → select the integration you created → Confirm. This step is mandatory to allow the integration to fill the data in the table.
Then open the table in a new view.
Copy the URL of the opened table. It should look as follows:
https://www.notion.so/username/87e015e43e7f4c9ebb6fb9612f644556?v=<VIEWID>
The ID after username/ and before ?v= is the NOTION_DB_ID. Paste it in your deployment environment variables.
Navigate to https://reqbin.com/
Paste https://api.notion.com/v1/users
in the URL field.
Go to Authorization tab and paste your NOTION_API_KEY in the Token field.
Click on the Headers tab and paste Notion-Version: 2022-06-28.
Click Send.
Copy the ID of the user that matches with your name, not the integration name. Verify that the type is person and not bot.
This copied ID is your NOTION_USER_ID.
Add the following new columns by clicking on the plus button.
Property | Type |
---|---|
Name
Text
Message
Text
Date
Date
Mention
Person