Skip to main content

Notification Functions

Five edge functions handle outbound notifications: email confirmations, reminders, onboarding emails, Slack messages, and incoming Fathom webhooks.

send-booking-notification

Sends booking confirmation emails to both the booker and the meeting owner when a meeting is scheduled.

See Booking & Meeting Functions for full documentation.

PropertyValue
TriggerCalled by create-calendar-event after event creation
APIResend (RESEND_API_KEY secret)
RecipientsBooker email + meeting owner email
Side EffectSets confirmation_sent_at on meeting record

send-onboarding-email

Sends a welcome email to new clients when they are onboarded onto the platform.

Input

interface OnboardingRequest {
clientId: string; // UUID of the new client
userEmail: string; // Email of the new client user
userName: string; // Display name
tempPassword?: string; // Temporary password (if set)
}

Email Content

The welcome email includes:

  • Welcome message with the client organization name
  • Login URL (https://app.1hourrecruitment.com/auth)
  • User's email and temporary password (if applicable)
  • Quick start guide links
  • Support contact information

Flow

Side Effects

  • Sends 1 email via Resend API
  • No database updates (fire-and-forget)

send-slack-notification

Sends notifications to a Slack channel via webhook when significant events occur (primarily meeting-related).

Input

interface SlackRequest {
event: 'meeting_booked' | 'meeting_cancelled' | 'meeting_completed';
meetingId?: string;
salesMeetingId?: string;
message?: string; // Custom message override
}

Slack Webhook

const webhookUrl = Deno.env.get('SLACK_WEBHOOK_URL');

await fetch(webhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
text: message,
blocks: [
{
type: 'section',
text: {
type: 'mrkdwn',
text: `*New Meeting Booked* :calendar:\n${bookerName} booked a meeting for ${formattedDate}`,
},
},
],
}),
});

Message Templates

EventMessage Format
meeting_booked"New Meeting Booked: {bookerName} booked with {ownerName} for {date}"
meeting_cancelled"Meeting Cancelled: {bookerName}'s meeting on {date} was cancelled"
meeting_completed"Meeting Completed: {ownerName} completed meeting with {bookerName}"

Required Secret

SecretValue
SLACK_WEBHOOK_URLSlack incoming webhook URL

fathom-meeting-webhook

Receives incoming webhooks from Fathom (AI meeting recorder). Updates meeting records with Fathom recording data.

Endpoint

POST /fathom-meeting-webhook

Fathom Payload

{
"event": "recording.completed",
"recording": {
"id": "fathom_recording_id",
"title": "Meeting Title",
"calendar_event_id": "google_event_id",
"summary": "AI-generated meeting summary",
"action_items": ["Follow up on proposal", "Send case studies"],
"recording_url": "https://fathom.video/...",
"transcript_url": "https://fathom.video/.../transcript",
"duration_seconds": 1800
}
}

Flow

Side Effects

  • Updates meetings or sales_meetings with Fathom summary data
  • Sets meeting status to 'completed'
  • Stores Fathom recording URL and summary in outcome_notes
  • Matches using calendar_event_id (the Google/Outlook event ID)

send-meeting-reminder

Sends reminder emails at 24 hours and 1 hour before scheduled meetings.

See Booking & Meeting Functions for full documentation.

PropertyValue
TriggerScheduled (cron or manual invocation)
APIResend (RESEND_API_KEY secret)
RecipientsBooker email
Side EffectSets reminder_24h_sent_at or reminder_1h_sent_at

Required Secrets Summary

SecretUsed By
RESEND_API_KEYsend-booking-notification, send-meeting-reminder, send-onboarding-email
SLACK_WEBHOOK_URLsend-slack-notification