@pithy-sh/email 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/capability.d.ts +2 -2
- package/dist/capability.d.ts.map +1 -1
- package/dist/capability.js +23 -2
- package/dist/consent/consent.d.ts +57 -0
- package/dist/consent/consent.d.ts.map +1 -0
- package/dist/consent/consent.js +135 -0
- package/dist/data/emailEvent.d.ts +1 -1
- package/dist/data/emailEvent.d.ts.map +1 -1
- package/dist/data/emailEvent.js +2 -1
- package/dist/data/emailJob.d.ts +6 -2
- package/dist/data/emailJob.d.ts.map +1 -1
- package/dist/data/emailJob.js +8 -3
- package/dist/data/emailSuppression.d.ts +1 -1
- package/dist/data/emailSuppression.d.ts.map +1 -1
- package/dist/data/emailSuppression.js +2 -1
- package/dist/data/tables.d.ts +4 -4
- package/dist/http/guards.d.ts +2 -2
- package/dist/http/guards.d.ts.map +1 -1
- package/dist/http/guards.js +12 -0
- package/dist/processing/activities.d.ts +9 -0
- package/dist/processing/activities.d.ts.map +1 -0
- package/dist/processing/activities.js +40 -0
- package/dist/purge/contribution.d.ts +27 -0
- package/dist/purge/contribution.d.ts.map +1 -0
- package/dist/purge/contribution.js +67 -0
- package/dist/send/enqueue.d.ts +26 -7
- package/dist/send/enqueue.d.ts.map +1 -1
- package/dist/send/enqueue.js +36 -13
- package/dist/templates/messages.d.ts +1 -2
- package/dist/templates/messages.d.ts.map +1 -1
- package/dist/templates/messages.js +7 -10
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/package.json +3 -3
- package/src/capability.ts +33 -7
- package/src/consent/consent.ts +183 -0
- package/src/data/emailEvent.ts +2 -1
- package/src/data/emailJob.ts +21 -8
- package/src/data/emailSuppression.ts +2 -1
- package/src/http/guards.ts +14 -2
- package/src/processing/activities.ts +41 -0
- package/src/purge/contribution.ts +83 -0
- package/src/send/enqueue.ts +62 -24
- package/src/templates/messages.ts +10 -13
- package/src/version.generated.ts +1 -1
|
@@ -44,14 +44,14 @@ import { EMAIL_ES } from "./messages.es";
|
|
|
44
44
|
*
|
|
45
45
|
* ## Only the kit's own copy
|
|
46
46
|
*
|
|
47
|
-
*
|
|
47
|
+
* Seventeen templates are here. The five whose words arrive as payload — `testerNudge`, `supportReply`,
|
|
48
48
|
* `operationalNotice`, `newsletter`, `marketingCampaign` — are the adopter's copy, chosen by a human
|
|
49
49
|
* for one message, and a catalog cannot translate a sentence it has never seen. Their **shell** still
|
|
50
50
|
* follows the job's locale (the severity word, the footer, the document's `lang` and `dir`), so a
|
|
51
51
|
* notice at locale `es` reads its severity in Spanish and its summary in whatever the caller wrote.
|
|
52
52
|
*/
|
|
53
53
|
|
|
54
|
-
/** The kit's English for every string the
|
|
54
|
+
/** The kit's English for every string the seventeen kit-authored templates and the shared shell render. */
|
|
55
55
|
const EMAIL_EN: MessageCatalog = {
|
|
56
56
|
// --- The shared shell ---
|
|
57
57
|
// The greeting is two keys rather than one with an optional placeholder, because a language that
|
|
@@ -123,7 +123,7 @@ const EMAIL_EN: MessageCatalog = {
|
|
|
123
123
|
"email/password_changed.text_body":
|
|
124
124
|
"Your account credentials were changed on {when}. If this wasn't you, contact support:",
|
|
125
125
|
|
|
126
|
-
// --- The account lifecycle
|
|
126
|
+
// --- The account lifecycle ---
|
|
127
127
|
// Each says what happened, what it means, and who to answer. The answer is a reply: the mail comes from the
|
|
128
128
|
// adopter's own address, so a reply reaches the people who can act on it.
|
|
129
129
|
"email/account_suspended.subject": "Your {app} account is suspended",
|
|
@@ -157,7 +157,7 @@ const EMAIL_EN: MessageCatalog = {
|
|
|
157
157
|
"Your {app} account and its data were erased on {purgedOn}. This cannot be undone.",
|
|
158
158
|
"email/deletion_complete.last": "This is the last email this account will receive.",
|
|
159
159
|
|
|
160
|
-
// --- Membership administration
|
|
160
|
+
// --- Membership administration ---
|
|
161
161
|
// An operator changed somebody's membership. Each names the organization, because a person in two
|
|
162
162
|
// accounts has to know which one changed, and closes on who to answer.
|
|
163
163
|
"email/organization_member_added.subject": "You were added to {organization}",
|
|
@@ -178,7 +178,7 @@ const EMAIL_EN: MessageCatalog = {
|
|
|
178
178
|
"You are now the owner of {organization} on {app}. You administer it, and you answer for it.",
|
|
179
179
|
"email/organization_member.contact": "If you did not expect this, reply to this email.",
|
|
180
180
|
|
|
181
|
-
// --- The organization lifecycle
|
|
181
|
+
// --- The organization lifecycle ---
|
|
182
182
|
// To an owner, when an operator acts on the organization itself. Each names it, and says the owner's own
|
|
183
183
|
// account is not what changed.
|
|
184
184
|
"email/organization_suspended.subject": "{organization} is suspended",
|
|
@@ -215,8 +215,7 @@ const EMAIL_EN: MessageCatalog = {
|
|
|
215
215
|
* Every language this capability's own copy is written in.
|
|
216
216
|
*
|
|
217
217
|
* **Bundled, not stamped.** The send Worker is deployed with this map inside it, so adding a language
|
|
218
|
-
* to the kit costs an adopter a package upgrade and no configuration at all
|
|
219
|
-
* #442. What still travels as a variable is the adopter's diff against this: usually nothing, and at
|
|
218
|
+
* to the kit costs an adopter a package upgrade and no configuration at all. What still travels as a variable is the adopter's diff against this: usually nothing, and at
|
|
220
219
|
* most the sentences they changed.
|
|
221
220
|
*/
|
|
222
221
|
export const EMAIL_MESSAGES: LocaleCatalogs = { en: EMAIL_EN, es: EMAIL_ES };
|
|
@@ -242,12 +241,10 @@ function languageOf(tag: string): string | null {
|
|
|
242
241
|
/**
|
|
243
242
|
* This package's own copy for `locale`, reduced to the language when the region was not written for.
|
|
244
243
|
*
|
|
245
|
-
* **The reduction has to happen here too, and not only over the stamped catalogs.**
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* exact-tag lookup on `es-AR` answered `undefined` — so a reader whose `pithy_auth_users.locale` is
|
|
250
|
-
* `es-AR` or `es-MX` got an English letter from a project that ships Spanish.
|
|
244
|
+
* **The reduction has to happen here too, and not only over the stamped catalogs.** With the kit's copy
|
|
245
|
+
* bundled here, the stamped catalog is empty for a project that overrode nothing, so an exact-tag
|
|
246
|
+
* lookup on `es-AR` alone would send a reader whose `pithy_auth_users.locale` is `es-AR` or `es-MX` an
|
|
247
|
+
* English letter from a project that ships Spanish.
|
|
251
248
|
*/
|
|
252
249
|
function bundledFor(locale: string): MessageCatalog | undefined {
|
|
253
250
|
const language = languageOf(locale);
|
package/src/version.generated.ts
CHANGED