Atomic CRM can receive inbound emails and automatically create or update contacts based on the email content. This feature is useful to keep your CRM up-to-date with the latest interactions with your contacts.
Atomic CRM uses Postmark to receive and process inbound emails.
You can use an existing Postmark account or create a new one. The free tier allows you to send or receive up to 100 emails per month.
To enable inbound email features, you need to create a webhook in Postmark.
- Go to your Postmark account
- Select your server (e.g. My First Server)
- Select the Inbound Stream (e.g. Default Inbound Stream)
- Go to the Setup Instructions tab
- Get your server’s inbound email address ([email protected])
- Set your server’s inbound webhook URL:
https://<user>:<password>@<project_id>.supabase.co/functions/v1/postmark
(e.g. https://user:[email protected]/functions/v1/postmark) - Save changes. That's it for the Postmark setup!
Note: The webhook URL includes 3 important pieces:
<user>
and<password>
are credentials you need to choose to secure the webhook. Please note them down as you will need them in the next step.<project_id>
is the Supabase project'sSUPABASE_PROJECT_ID
Note: The server’s inbound email address can be customized by registering a domain to your Postmark account.
Atomic CRM uses a Supabase Edge Function to handle the webhook and process the received emails. You need to configure your Supabase project to handle the incoming requests.
In a terminal, after linking your Supabase project, run the following commands:
npx supabase secrets set POSTMARK_WEBHOOK_USER=<user>
npx supabase secrets set POSTMARK_WEBHOOK_PASSWORD=<password>
npx supabase secrets set POSTMARK_WEBHOOK_AUTHORIZED_IPS=<comma-separated list of IPs>
These commands will push the secrets to your remote Supabase project.
Note: The list of authorized Postmark IPs can be found in the Postmark support pages.
If you are using this repository's GitHub Actions to automatically deploy to your Supabase instance, you will need to set these secrets in your repository's settings.
POSTMARK_WEBHOOK_USER=<user>
POSTMARK_WEBHOOK_PASSWORD=<password>
POSTMARK_WEBHOOK_AUTHORIZED_IPS=<comma-separated list of IPs>
Store the Postmark inbound email address in a .env
file at the root of the project, so that users can easily find it in the application.
To test inbound email features locally, you will need to do the following:
- Start the Supabase Edge Functions locally:
make start-supabase-functions
- Open your local Supabase instance for public access, e.g. using ngrok:
ngrok http 54321
- Configure your Postmark server's inbound webhook URL to point to your ngrok URL:
https://testuser:testpwd@<ngrok-url>/functions/v1/postmark
(e.g. https://testuser:[email protected]/functions/v1/postmark) - Send an email to your Postmark server's inbound email address