From fc9787374e9b0c38bfdac6ff04787a2cb15f0ee4 Mon Sep 17 00:00:00 2001 From: Harlan Wilton Date: Mon, 12 Oct 2026 18:32:14 +1100 Subject: [PATCH] feat(identity): add one optional welcome email --- COPY.md | 9 ++ .../identity/app/pages/onboarding/email.vue | 16 +- layers/identity/server/api/me/email.patch.ts | 21 ++- layers/identity/server/api/unsubscribe.get.ts | 2 +- .../identity/server/api/unsubscribe.post.ts | 2 +- .../server/api/unsubscribe/undo.post.ts | 2 +- layers/identity/server/schemas/unsubscribe.ts | 2 +- .../identity/server/utils/account-deletion.ts | 1 + layers/identity/server/utils/email.ts | 10 +- layers/identity/server/utils/unsubscribe.ts | 37 +++-- layers/identity/server/utils/welcome-email.ts | 74 +++++++++ layers/identity/shared/contracts/account.ts | 7 +- migrations/0156_welcome_email_delivery.sql | 12 ++ shared/welcome-email-copy.ts | 11 ++ test/unit/account-deletion.nuxt.test.ts | 2 + test/unit/digest-opt-in-address.test.ts | 19 +++ test/unit/email-form-submit.nuxt.test.ts | 34 +++- test/unit/welcome-email.test.ts | 151 ++++++++++++++++++ 18 files changed, 385 insertions(+), 27 deletions(-) create mode 100644 layers/identity/server/utils/welcome-email.ts create mode 100644 migrations/0156_welcome_email_delivery.sql create mode 100644 shared/welcome-email-copy.ts create mode 100644 test/unit/welcome-email.test.ts diff --git a/COPY.md b/COPY.md index 5d810367..29491f04 100644 --- a/COPY.md +++ b/COPY.md @@ -11,6 +11,15 @@ contradicts this file is a bug. ## Canonical assets +The optional welcome email uses the subject "Your skilld account is ready". +Its body is "Like Skills to find them again in your account." and "Watch the Repositories you use and see what changed." +Its final line is "Your weekly and monthly email choices stay as you set them." +Its one main action is "Open your account", linking to `/me`. +Its footer is "Stop welcome emails", linking to a signed welcome unsubscribe URL. +Onboarding offers an unchecked choice: "Send me one welcome email with account tips." +The missing-address message is "Add an email address, or turn off all email choices." +Welcome unsubscribe says "You will not get welcome emails. Your weekly and digest settings are unchanged." + Skill validation in `/me` uses "Skill validation" and "Some of your Skills have validation issues." The action is "View validation issues". Source links use "Open SKILL.md". Email summaries use the subject "Your Skills have validation issues" and link to `/me?view=repositories`. diff --git a/layers/identity/app/pages/onboarding/email.vue b/layers/identity/app/pages/onboarding/email.vue index 26cb4ee3..b176a863 100644 --- a/layers/identity/app/pages/onboarding/email.vue +++ b/layers/identity/app/pages/onboarding/email.vue @@ -1,6 +1,7 @@