feat(messaging): extend messaging to email with SendGrid adapter (@quatrain/messaging-sendgrid) #19
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
qa:preview
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
quatrain/core#19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
🎯 Goal
Extend the
@quatrain/messagingecosystem to support transactional emails by creating a dedicated SendGrid adapter package:@quatrain/messaging-sendgrid.📋 Context & Motivation
Currently,
@quatrain/messagingdefines theEmailCapableAdapterinterface (sendEmailandsendEmails), but lacks a production-ready email adapter implementation (only@quatrain/messaging-firebaseexists, which focuses on push notifications).Consuming backend applications currently interact directly with
@sendgrid/mailoutside of the unified Quatrain messaging abstraction layer. Providing@quatrain/messaging-sendgridwill:🛠️ Proposed Architecture & Specifications
New Package Creation:
packages/messaging-sendgrid@quatrain/messaging-sendgridgit+https://github.com/Quatrain/Core.gitwith"directory": "packages/messaging-sendgrid"Adapter Implementation:
SendgridMessagingAdapterextendingAbstractMessagingAdapterand implementingEmailCapableAdapter.sendEmail(recipient: MessagingRecipient, message: NotificationMessage): Promise<any>.sendEmails(recipients: MessagingRecipient[], message: NotificationMessage): Promise<any>.Configuration & Parameters:
SendgridMessagingParametersextendingMessagingParameters:apiKey: SendGrid API key (fail-fast validation in constructor).defaultSender: Default "From" email and optional display name.sandboxMode/debug: Boolean flag for development/dry-run mode without sending real emails.Message Formatting & Capabilities:
as anybypasses.Logging & Error Handling:
this.addLogger('Messaging:SendGrid').Documentation & Quality Gates:
README.mdandHOWTO.mdwith usage examples.tsc -p tsconfig.jsonwith 0 errors).SendgridMessagingAdapter.test.ts) with high test coverage and mocked@sendgrid/mail..npmignoreandpackage.json"files"entry excluding all test files and configs.🧪 Acceptance Criteria
@quatrain/messaging-sendgridcreated inpackages/messaging-sendgrid.EmailCapableAdaptercontract adhering to Quatrain architectural standards.turbo run build).README.md,HOWTO.md, cleanpackage.json, and.npmignore.