Skip to main content
POST
https://searchcompany-main.up.railway.app
/
webhooks
/
send-onboarding-email
Send Onboarding Email
curl --request POST \
  --url https://searchcompany-main.up.railway.app/webhooks/send-onboarding-email
{
  "success": true,
  "message": "Onboarding email sent to [email protected]"
}
Webhook endpoint that receives Notion database automation events. When a CRM entry is moved to β€œSend Email” status, this automatically sends the onboarding transactional email via Loops.
This is a webhook endpoint - called by Notion automations, not directly by users.

How It Works

  1. User submits email on website β†’ stored in Notion CRM (Waitlist column)
  2. You manually move the card to β€œSend Email” column in Notion
  3. Notion automation triggers webhook to this endpoint
  4. Endpoint extracts email from payload and sends onboarding email via Loops
  5. Contact is automatically added to Loops audience (addToAudience: true)

Notion Automation Setup

  1. Open your CRM database in Notion
  2. Click … menu β†’ Automations
  3. Create new automation:
    • Trigger: Status set to Send Email
    • Action: Send webhook
    • URL: https://searchcompany-main.up.railway.app/webhooks/send-onboarding-email
    • Content: Check only Email property
  4. Click Enable

Request Body (from Notion Automation)

Notion automation sends the selected properties in the payload:
{
  "source": {
    "type": "automation"
  },
  "data": {
    "properties": {
      "Email": {
        "type": "title",
        "title": [
          {
            "type": "text",
            "text": {
              "content": "[email protected]"
            }
          }
        ]
      }
    }
  }
}

Response

success
boolean
true if email sent successfully
message
string
Status message with recipient email
{
  "success": true,
  "message": "Onboarding email sent to [email protected]"
}

Flow Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Website   │────▢│   Notion    │────▢│   Backend   β”‚
β”‚  (submit)   β”‚     β”‚  (Waitlist) β”‚     β”‚  (webhook)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚                    β”‚
                          β”‚ Move to            β”‚ Send email
                          β”‚ "Send Email"       β”‚ via Loops
                          β–Ό                    β–Ό
                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                   β”‚   Notion    β”‚     β”‚    Loops    β”‚
                   β”‚ (automation)β”‚     β”‚  (email)    β”‚
                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜