Azure Functions project for email delivery in the PatchNotes application.
A TypeScript Azure Functions app that handles email notifications via Resend. Provides welcome emails and weekly digest emails.
| Function | Trigger | Description |
|---|---|---|
sendWelcome |
HTTP POST | Sends welcome email to new users |
sendDigest |
Timer | Sends weekly digest of release activity |
pnpm install
pnpm startThis builds the TypeScript and starts the Azure Functions runtime.
| Command | Description |
|---|---|
pnpm build |
Compile TypeScript |
pnpm watch |
Watch mode compilation |
pnpm clean |
Remove dist/ |
pnpm start |
Clean, build, and start function host |
Create a local.settings.json:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "node",
"RESEND_API_KEY": "<your-resend-api-key>"
}
}patchnotes-email/
├── src/
│ ├── functions/
│ │ ├── sendWelcome.ts # Welcome email (HTTP trigger)
│ │ └── sendDigest.ts # Weekly digest (timer trigger)
│ └── lib/
│ └── resend.ts # Resend client setup
├── host.json # Function host configuration
├── package.json
└── tsconfig.json
This project uses Prisma for database access. EF Core owns all migrations — the PatchNotes.Data project is the source of truth for the database schema. Prisma is introspection-only here.
Important: Never run prisma migrate or prisma db push in this project. Prisma only reads the schema via prisma db pull.
When you add or modify an EF Core migration in PatchNotes.Data, you must also update the Prisma schema:
cd patchnotes-email
pnpm db:pull # Introspect the database and update prisma/schema.prisma
pnpm db:generate # Regenerate the Prisma client from the updated schemaCommit both the EF Core migration and the updated Prisma schema together.
CI runs a schema-drift job that:
- Spins up a SQL Server instance
- Applies all EF Core migrations
- Runs
prisma db pullagainst that database - Fails if
prisma/schema.prismadiffers from what's committed
This prevents the email function from silently breaking due to schema drift.
- @azure/functions - Azure Functions SDK
- resend - Email delivery API
- prisma / @prisma/client - Database access (introspection-only)