Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt

Use this file to discover all available pages before exploring further.

Feature ID: PF-86
Status: ✅ Complete
Spec Reference: PF-86-platform-email-signature-service.md
Last Updated: 2026-03-20

Overview

PF-86 adds organization-wide and per-user HTML/text email signatures with optional compliance disclaimers. Consumers integrate through the Platform Integration Layer at @/platform/email-signatures and shared Deno helpers under supabase/functions/_shared/email-signature.ts (or equivalent). PF-10 notification sends and CE email campaigns are MVP consumers; other cores call the same APIs when they send mail.

Integration Points (from Spec)

DependencyTypePurpose
PF-01 (Orgs)Platform / DataOrganization name, address, contact fields for variable substitution
PF-06 (Profiles)Platform / DataUser name, title, phone, email for variable substitution
PF-10 (Notifications)PlatformInjects rendered signature into transactional notification emails
CE (Campaigns)Consumer coreInjects organization (and applicable user) signature into campaign sends
PF-30 (RBAC)Platformpf.email_signatures.* permission keys for settings UI
pf_module_settingsPlatformFeature toggles: require org default, allow user customization, require disclaimer

Platform Layer Contract (target)

  • Module path: @/platform/email-signatures (to be created in implementation).
  • Hooks (from spec): useOrganizationEmailSignature, useUserEmailSignature, useEmailSignatureMutation, useRenderEmailSignature.
  • Server shared utility: supabase/functions/_shared/email-signature.ts — substitution, sanitization, HTML/text rendering; imported by PF-10/CE send paths and optionally wrapped by a thin render-email-signature edge function for HTTP-only callers.
  • Events / REST: No new event or public REST contract for MVP (direct calls / shared utilities only).

Security and Tenant Isolation

  • All persisted rows in pf_email_signatures are tenant-scoped via organization_id; RLS + pf_has_email_signature_access per spec.
  • HTML stored and rendered MUST be sanitized (save + render) to reduce XSS risk in email clients; no PHI in platform-provided templates—disclaimer text is organization-configured.
  • Optional HTTP edge wrapper MUST use getCorsHeaders(req.headers.get('origin')), structured logging via createLogger from _shared/logger.ts, and appropriate JWT verification per function config (see .cursor/rules/edge-functions.md).

Event Contracts

None for MVP. Revisit if a future phase publishes “signature updated” events for cache invalidation across workers.