@stacksjs/defaults 0.75.137 → 0.75.139
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.
|
@@ -31,7 +31,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
|
|
|
31
31
|
| `@stacksjs/cloud` | [`stacks-cloud`](../stacks-cloud/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cloud/src/index.ts) | 10 |
|
|
32
32
|
| `@stacksjs/cms` | [`stacks-cms`](../stacks-cms/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cms/src/index.ts) | 5 |
|
|
33
33
|
| `@stacksjs/collections` | [`stacks-collections`](../stacks-collections/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/collections/src/index.ts) | 2 |
|
|
34
|
-
| `@stacksjs/commerce` | [`stacks-commerce`](../stacks-commerce/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/index.ts) |
|
|
34
|
+
| `@stacksjs/commerce` | [`stacks-commerce`](../stacks-commerce/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/index.ts) | 13 |
|
|
35
35
|
| `@stacksjs/composables` | [`stacks-composables`](../stacks-composables/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/composables/src/index.ts) | 18 |
|
|
36
36
|
| `@stacksjs/config` | [`stacks-config`](../stacks-config/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/index.ts) | 15 |
|
|
37
37
|
| `@stacksjs/cron` | [`stacks-cron`](../stacks-cron/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cron/src/index.ts) | 4 |
|
|
@@ -63,7 +63,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
|
|
|
63
63
|
| `@stacksjs/mobile` | [`stacks-mobile`](../stacks-mobile/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/mobile/src/index.ts) | 12 |
|
|
64
64
|
| `@stacksjs/model-meta` | [`stacks-models`](../stacks-models/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/model-meta/src/index.ts) | 1 |
|
|
65
65
|
| `@stacksjs/newsletter` | [`stacks-newsletter`](../stacks-newsletter/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/newsletter/src/index.ts) | 7 |
|
|
66
|
-
| `@stacksjs/notifications` | [`stacks-notifications`](../stacks-notifications/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/index.ts) |
|
|
66
|
+
| `@stacksjs/notifications` | [`stacks-notifications`](../stacks-notifications/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/index.ts) | 13 |
|
|
67
67
|
| `@stacksjs/objects` | [`stacks-objects`](../stacks-objects/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/objects/src/index.ts) | 4 |
|
|
68
68
|
| `@stacksjs/orm` | [`stacks-orm`](../stacks-orm/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/index.ts) | 60 |
|
|
69
69
|
| `@stacksjs/pagination` | [`stacks-pagination`](../stacks-pagination/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/pagination/src/index.ts) | 0 |
|
|
@@ -307,11 +307,11 @@ Evidence directory: [2 retained tests](https://github.com/stacksjs/stacks/blob/m
|
|
|
307
307
|
|
|
308
308
|
Guidance: [`stacks-commerce`](../stacks-commerce/SKILL.md). Source: [storage/framework/core/commerce/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/index.ts).
|
|
309
309
|
|
|
310
|
-
Declared runtime exports: `PriceFormatError`, `auctions`, `breakdownFor`, `carts`, `catalog`, `catalogImport`, `commerce`, `coupons`, `currencyExponent`, `customers`, `decimalToMinor`, `default`, `devices`, `errors`, `formatCurrency`, `formatMinor`, `giftCards`, `minorToDecimal`, `minorToInput`, `minorToMajor`, `money`, `moneyInputError`, `moneyInputStep`, `multiplierOf`, `orders`, `parseMoneyInput`, `parseSalesTaxSetup`, `parseTaxRateWriteData`, `payments`, `products`, `receipts`, `register`, `releases`, `restaurant`, `restockedQuantity`, `shippings`, `tax`, `waitlists`.
|
|
310
|
+
Declared runtime exports: `PriceFormatError`, `auctions`, `breakdownFor`, `carts`, `catalog`, `catalogImport`, `commerce`, `coupons`, `currencyExponent`, `customers`, `decimalToMinor`, `default`, `devices`, `errors`, `formatCurrency`, `formatMinor`, `giftCards`, `minorToDecimal`, `minorToInput`, `minorToMajor`, `money`, `moneyInputError`, `moneyInputStep`, `multiplierOf`, `orders`, `parseMoneyInput`, `parseSalesTaxSetup`, `parseTaxRateWriteData`, `payments`, `products`, `receiptLinesText`, `receipts`, `register`, `releases`, `restaurant`, `restockedQuantity`, `shippings`, `tax`, `waitlists`.
|
|
311
311
|
|
|
312
|
-
Local source modules: [src/auctions/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/auctions/index.ts), [src/carts/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/carts/index.ts), [src/catalog.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/catalog.ts), [src/coupons/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/coupons/index.ts), [src/customers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/customers/index.ts), [src/devices/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/devices/index.ts), [src/errors/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/errors/index.ts), [src/gift-cards/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/gift-cards/index.ts), [src/imports/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/imports/index.ts), [src/inventory.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/inventory.ts), [src/money.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/money.ts), [src/orders/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/orders/index.ts), [src/payments/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/payments/index.ts), [src/products/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/products/index.ts), [src/receipts/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/receipts/index.ts), [src/register.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/register.ts), [src/releases.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/releases.ts), [src/sales-tax.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/sales-tax.ts), [src/shippings/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/shippings/index.ts), [src/tax-input.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/tax-input.ts), [src/tax/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/tax/index.ts), [src/waitlists/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/waitlists/index.ts), [src/waitlists/restaurant/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/waitlists/restaurant/index.ts).
|
|
312
|
+
Local source modules: [src/auctions/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/auctions/index.ts), [src/carts/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/carts/index.ts), [src/catalog.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/catalog.ts), [src/coupons/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/coupons/index.ts), [src/customers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/customers/index.ts), [src/devices/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/devices/index.ts), [src/errors/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/errors/index.ts), [src/gift-cards/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/gift-cards/index.ts), [src/imports/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/imports/index.ts), [src/inventory.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/inventory.ts), [src/money.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/money.ts), [src/orders/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/orders/index.ts), [src/payments/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/payments/index.ts), [src/products/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/products/index.ts), [src/receipt-text.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/receipt-text.ts), [src/receipts/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/receipts/index.ts), [src/register.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/register.ts), [src/releases.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/releases.ts), [src/sales-tax.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/sales-tax.ts), [src/shippings/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/shippings/index.ts), [src/tax-input.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/tax-input.ts), [src/tax/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/tax/index.ts), [src/waitlists/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/waitlists/index.ts), [src/waitlists/restaurant/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/waitlists/restaurant/index.ts).
|
|
313
313
|
|
|
314
|
-
Evidence directory: [
|
|
314
|
+
Evidence directory: [13 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
|
|
315
315
|
|
|
316
316
|
### @stacksjs/composables
|
|
317
317
|
|
|
@@ -607,11 +607,11 @@ Evidence directory: [7 retained tests](https://github.com/stacksjs/stacks/blob/m
|
|
|
607
607
|
|
|
608
608
|
Guidance: [`stacks-notifications`](../stacks-notifications/SKILL.md). Source: [storage/framework/core/notifications/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/index.ts).
|
|
609
609
|
|
|
610
|
-
Declared runtime exports: `BroadcastNotificationDriver`, `DatabaseNotificationDriver`, `bulkSetPreferences`, `emailParagraphs`, `ensureSuccessfulEmailResult`, `ensureSuccessfulNotificationResults`, `filterChannelsByPreferences`, `getNotificationPreferences`, `makeDeliveryRecord`, `notification`, `notificationChannel`, `notificationEmailHtml`, `notificationEmailText`, `notify`, `recordNotificationDelivery`, `resolveDeliveryRecipient`, `setNotificationPreference`, `useBroadcast`, `useChat`, `useDatabase`, `useEmail`, `useNotification`, `usePush`, `useSMS`, `wherePreferenceCategory`.
|
|
610
|
+
Declared runtime exports: `BroadcastNotificationDriver`, `DEFAULT_SMS_OPT_OUT`, `DEFAULT_UNSUBSCRIBE_NOTICE`, `DatabaseNotificationDriver`, `accountNotificationTemplates`, `bulkSetPreferences`, `commerceNotificationTemplates`, `createNotificationTemplates`, `defineNotificationTemplates`, `emailParagraphs`, `ensureSuccessfulEmailResult`, `ensureSuccessfulNotificationResults`, `filterChannelsByPreferences`, `getNotificationPreferences`, `interpolateNotificationText`, `listUnsubscribeHeaders`, `makeDeliveryRecord`, `notification`, `notificationChannel`, `notificationEmailHtml`, `notificationEmailMessage`, `notificationEmailText`, `notificationSmsBody`, `notificationTemplateVariables`, `notificationUnsubscribeLinks`, `notificationUnsubscribeToken`, `notify`, `parseNotificationUnsubscribeToken`, `recordNotificationDelivery`, `renderNotificationTemplate`, `resolveDeliveryRecipient`, `resolveNotificationLocale`, `setNotificationPreference`, `subscriptionNotificationTemplates`, `unsubscribeTokenFromRequest`, `unsubscribeWithToken`, `useBroadcast`, `useChat`, `useDatabase`, `useEmail`, `useNotification`, `usePush`, `useSMS`, `wherePreferenceCategory`.
|
|
611
611
|
|
|
612
|
-
Local source modules: [src/delivery.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/delivery.ts), [src/drivers/broadcast.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/drivers/broadcast.ts), [src/drivers/database.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/drivers/database.ts), [src/drivers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/drivers/index.ts), [src/email-body.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/email-body.ts), [src/preferences.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/preferences.ts).
|
|
612
|
+
Local source modules: [src/delivery.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/delivery.ts), [src/drivers/broadcast.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/drivers/broadcast.ts), [src/drivers/database.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/drivers/database.ts), [src/drivers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/drivers/index.ts), [src/email-body.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/email-body.ts), [src/preferences.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/preferences.ts), [src/templates.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/templates.ts), [src/unsubscribe.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/src/unsubscribe.ts).
|
|
613
613
|
|
|
614
|
-
Evidence directory: [
|
|
614
|
+
Evidence directory: [13 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/notifications/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
|
|
615
615
|
|
|
616
616
|
### @stacksjs/objects
|
|
617
617
|
|
|
@@ -78,6 +78,79 @@ missing optional schema compatibility from real persistence failures. Apply
|
|
|
78
78
|
model-driven migrations before relying on persistence. Inspect channel results
|
|
79
79
|
and transport results rather than assuming a delivery log is provider proof.
|
|
80
80
|
|
|
81
|
+
## Marketing: unsubscribe links and opt-out lines
|
|
82
|
+
|
|
83
|
+
Give a marketing notification `payload.unsubscribe`, built per person with
|
|
84
|
+
`notificationUnsubscribeLinks(userId, { notice })`:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
await notify(
|
|
88
|
+
{ userId, email },
|
|
89
|
+
{ subject, body, unsubscribe: notificationUnsubscribeLinks(userId, { notice: 'You get these because marketing email is on.' }) },
|
|
90
|
+
['email'],
|
|
91
|
+
{ category: 'marketing' },
|
|
92
|
+
)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The email's footer then shows the notice, **Unsubscribe** (`url`, default
|
|
96
|
+
`{APP_URL}/unsubscribe?token=`) and **Email preferences** (`/settings`) instead
|
|
97
|
+
of "do not reply"; the text part spells the link out; and the message carries
|
|
98
|
+
`List-Unsubscribe: <oneClickUrl>` plus `List-Unsubscribe-Post:
|
|
99
|
+
List-Unsubscribe=One-Click` (RFC 8058, default
|
|
100
|
+
`{APP_URL}/api/notifications/unsubscribe?token=`). `payload.headers` adds
|
|
101
|
+
other headers. The pure builders are `notificationEmailMessage`,
|
|
102
|
+
`notificationEmailHtml`, `notificationEmailText` and `listUnsubscribeHeaders`.
|
|
103
|
+
|
|
104
|
+
The token (`notificationUnsubscribeToken`, `parseNotificationUnsubscribeToken`)
|
|
105
|
+
is `base64url("{userId}:{channel}:{category}:{hmac}")` signed with `APP_KEY`,
|
|
106
|
+
which must be set in production. It does not expire. It turns off one
|
|
107
|
+
preference (channel + category), unlike `@stacksjs/email`'s tokens, which
|
|
108
|
+
suppress an address for good. The app owns the page and the route; the route's
|
|
109
|
+
handler is `unsubscribeWithToken(await unsubscribeTokenFromRequest(request))`,
|
|
110
|
+
which reads the query string (one-click form POSTs) before a JSON body, and
|
|
111
|
+
answers 422 when it returns null. Ask before unsubscribing on the page, so a
|
|
112
|
+
link scanner opening the URL changes nothing.
|
|
113
|
+
|
|
114
|
+
A `marketing` text ends with "Reply STOP to opt out." (`notificationSmsBody`).
|
|
115
|
+
`payload.smsOptOut` replaces the line (and adds it to other categories), and
|
|
116
|
+
`false` leaves it out. STOP only becomes an opt-out the app sees when inbound
|
|
117
|
+
SMS is wired up; see `stacks-sms`.
|
|
118
|
+
|
|
119
|
+
## Templates: one catalog of localized messages
|
|
120
|
+
|
|
121
|
+
`@stacksjs/notifications/templates` (pure, browser-safe; also exported from the
|
|
122
|
+
root) holds named messages with copy per language and an optional button:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import { accountNotificationTemplates, commerceNotificationTemplates, createNotificationTemplates, defineNotificationTemplates, subscriptionNotificationTemplates } from '@stacksjs/notifications/templates'
|
|
126
|
+
|
|
127
|
+
const templates = createNotificationTemplates({
|
|
128
|
+
...accountNotificationTemplates({ resetPassword: '/forgot-password' }),
|
|
129
|
+
...commerceNotificationTemplates({ orders: '/purchases' }),
|
|
130
|
+
...subscriptionNotificationTemplates({ billing: '/billing' }),
|
|
131
|
+
...defineNotificationTemplates({ /* the app's own: { copy: { en, de }, action?: { path, label: { en, de } } } */ }),
|
|
132
|
+
}, { baseUrl: () => process.env.APP_URL || '' })
|
|
133
|
+
|
|
134
|
+
const { subject, body, action } = templates.render('password_changed', { app: 'HQ', support_email }, locale)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
- `{{name}}` placeholders; a missing variable renders empty, and a button whose
|
|
138
|
+
path needs a missing variable is dropped rather than sent broken. A path that
|
|
139
|
+
renders absolute (`{{set_password_url}}`) is used as is.
|
|
140
|
+
- Locale: exact, then the base language (`de-AT` → `de`), then `fallbackLocale`.
|
|
141
|
+
- `templates.names` / `templates.has()` validate input (e.g. a staff API that
|
|
142
|
+
sends a named template).
|
|
143
|
+
- Built-ins: account (`password_changed`, `email_changed`, `account_deleted`,
|
|
144
|
+
`account_created`), commerce (`order_receipt`, `order_refunded`, `new_sale`,
|
|
145
|
+
`account_credit_added`), subscription (`subscription_trial_ending`,
|
|
146
|
+
`subscription_payment_failed`, `subscription_ended`). Every one has English
|
|
147
|
+
and German copy with the same variables (a test checks this). They are
|
|
148
|
+
transactional: send them with `ignorePreferences: true`.
|
|
149
|
+
- Receipts: build `lines` with `receiptLinesText(lines, currency, locale)` from
|
|
150
|
+
`@stacksjs/commerce/receipt-text` so amounts carry their currency.
|
|
151
|
+
- `account_created` carries a credential link: send it directly, not through a
|
|
152
|
+
stored queue that keeps the body.
|
|
153
|
+
|
|
81
154
|
## Channel factories
|
|
82
155
|
|
|
83
156
|
- `useEmail(driver?)` returns a sendable transport. Without a driver it uses
|
package/ide/vscode/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"publisher": "Stacks",
|
|
3
3
|
"name": "vscode-stacks",
|
|
4
4
|
"displayName": "Stacks",
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.139",
|
|
6
6
|
"description": "Stacks, built into VS Code: stx templates, pickier linting and formatting, encrypted env files, the dev server preview and every buddy command. No other extensions required.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"funding": "https://github.com/sponsors/chrisbbreuer",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/defaults",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.139",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@iconify-json/f7": "^1.2.2",
|
|
57
57
|
"@iconify-json/hugeicons": "^1.2.35",
|
|
58
|
-
"@stacksjs/mobile": "0.75.
|
|
58
|
+
"@stacksjs/mobile": "0.75.139",
|
|
59
59
|
"@stacksjs/sanitizer": "^0.2.422",
|
|
60
60
|
"@xterm/addon-fit": "^0.11.0",
|
|
61
61
|
"@xterm/xterm": "^6.0.0",
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// breaks kept, addresses as links) and, when the notification names one, a
|
|
5
5
|
// button to where it happened. Same <EmailLayout> as the other prebaked
|
|
6
6
|
// mailers (stacksjs/stacks#1901); an app's own resources/emails/notification
|
|
7
|
-
// wins over this one.
|
|
7
|
+
// wins over this one. A notification with `unsubscribe` (marketing) says why
|
|
8
|
+
// it came and links to Unsubscribe in the footer instead of "do not reply".
|
|
8
9
|
const appName = props.appName || 'Stacks'
|
|
9
10
|
const primaryColor = props.primaryColor || '#3451b2'
|
|
10
11
|
const subject = props.subject || appName
|
|
@@ -12,6 +13,9 @@ const paragraphs = Array.isArray(props.paragraphs) ? props.paragraphs : []
|
|
|
12
13
|
const actionUrl = props.actionUrl || ''
|
|
13
14
|
const actionLabel = props.actionLabel || 'Open'
|
|
14
15
|
const preheader = props.preheader || ''
|
|
16
|
+
const unsubscribeUrl = props.unsubscribeUrl || ''
|
|
17
|
+
const unsubscribeNotice = props.unsubscribeNotice || 'You are receiving this because these emails are turned on in your settings.'
|
|
18
|
+
const preferencesUrl = props.preferencesUrl || ''
|
|
15
19
|
const year = props.year || new Date().getFullYear()
|
|
16
20
|
</script>
|
|
17
21
|
|
|
@@ -36,7 +40,12 @@ const year = props.year || new Date().getFullYear()
|
|
|
36
40
|
<template #footer>
|
|
37
41
|
<tr>
|
|
38
42
|
<td style="padding:20px 40px;background-color:#f9fafb;border-top:1px solid #e5e7eb;">
|
|
39
|
-
|
|
43
|
+
@if(unsubscribeUrl)
|
|
44
|
+
<p style="margin:0;color:#6b7280;font-size:12px;text-align:center;">{{ unsubscribeNotice }}</p>
|
|
45
|
+
<p style="margin:8px 0 0 0;color:#6b7280;font-size:12px;text-align:center;"><a href="{{ unsubscribeUrl }}" style="color:#6b7280;text-decoration:underline;">Unsubscribe</a>@if(preferencesUrl) · <a href="{{ preferencesUrl }}" style="color:#6b7280;text-decoration:underline;">Email preferences</a>@endif</p>
|
|
46
|
+
@else
|
|
47
|
+
<p style="margin:0;color:#6b7280;font-size:12px;text-align:center;">This is an automated message from {{ appName }}. Please do not reply to this email.</p>
|
|
48
|
+
@endif
|
|
40
49
|
<p style="margin:10px 0 0 0;color:#9ca3af;font-size:11px;text-align:center;">© {{ year }} {{ appName }}. All rights reserved.</p>
|
|
41
50
|
</td>
|
|
42
51
|
</tr>
|