@buffcore/emails 0.0.0-stage → 0.8.40
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/LICENSE +202 -0
- package/NOTICE +4 -0
- package/README.md +8 -2
- package/dist/email.d.ts +48 -0
- package/dist/email.js +54 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +52 -0
- package/dist/locales/alerts.en.d.ts +31 -0
- package/dist/locales/alerts.en.js +30 -0
- package/dist/locales/alerts.es.json +26 -0
- package/dist/locales/automation.en.d.ts +17 -0
- package/dist/locales/automation.en.js +16 -0
- package/dist/locales/automation.es.json +15 -0
- package/dist/locales/consent.en.d.ts +12 -0
- package/dist/locales/consent.en.js +11 -0
- package/dist/locales/consent.es.json +10 -0
- package/dist/locales/devices.en.d.ts +7 -0
- package/dist/locales/devices.en.js +6 -0
- package/dist/locales/devices.es.json +5 -0
- package/dist/locales/en.d.ts +5 -0
- package/dist/locales/en.js +4 -0
- package/dist/locales/errors.en.d.ts +10 -0
- package/dist/locales/errors.en.js +9 -0
- package/dist/locales/errors.es.json +8 -0
- package/dist/locales/es.json +3 -0
- package/dist/locales/identity.en.d.ts +21 -0
- package/dist/locales/identity.en.js +20 -0
- package/dist/locales/identity.es.json +16 -0
- package/dist/locales/inbox.en.d.ts +15 -0
- package/dist/locales/inbox.en.js +14 -0
- package/dist/locales/inbox.es.json +13 -0
- package/dist/locales/password.en.d.ts +13 -0
- package/dist/locales/password.en.js +12 -0
- package/dist/locales/password.es.json +11 -0
- package/dist/locales/privacy.en.d.ts +20 -0
- package/dist/locales/privacy.en.js +19 -0
- package/dist/locales/privacy.es.json +18 -0
- package/dist/templates/alerts.d.ts +48 -0
- package/dist/templates/alerts.js +61 -0
- package/dist/templates/automation.d.ts +35 -0
- package/dist/templates/automation.js +53 -0
- package/dist/templates/consent.d.ts +14 -0
- package/dist/templates/consent.js +32 -0
- package/dist/templates/devices.d.ts +8 -0
- package/dist/templates/devices.js +29 -0
- package/dist/templates/errors.d.ts +8 -0
- package/dist/templates/errors.js +15 -0
- package/dist/templates/identity.d.ts +19 -0
- package/dist/templates/identity.js +47 -0
- package/dist/templates/inbox.d.ts +20 -0
- package/dist/templates/inbox.js +48 -0
- package/dist/templates/password.d.ts +13 -0
- package/dist/templates/password.js +26 -0
- package/dist/templates/privacy.d.ts +22 -0
- package/dist/templates/privacy.js +47 -0
- package/package.json +40 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @buffcore/emails
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React Email layout and the core email templates for BuffCore.
|
|
4
|
+
|
|
5
|
+
Part of [BuffApe](https://github.com/buffape/buffape), the open-source way to build a product with AI agents. Start one with `npm create @buffcore@latest my-app`.
|
|
6
|
+
|
|
7
|
+
## License
|
|
8
|
+
|
|
9
|
+
Apache-2.0. Copyright © 2026 BuffApe. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
|
package/dist/email.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import { type T } from '@buffcore/i18n';
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
/** What every email knows: who it's from, in which language, and how to say things. */
|
|
6
|
+
export interface EmailContext {
|
|
7
|
+
t: T;
|
|
8
|
+
locale: string;
|
|
9
|
+
productName: string;
|
|
10
|
+
}
|
|
11
|
+
/** An email template: a subject and a body, both written through `t()`. */
|
|
12
|
+
export interface EmailTemplate<P> {
|
|
13
|
+
key: string;
|
|
14
|
+
subject: (props: P, ctx: EmailContext) => string;
|
|
15
|
+
preview?: (props: P, ctx: EmailContext) => string;
|
|
16
|
+
Body: (props: P & {
|
|
17
|
+
ctx: EmailContext;
|
|
18
|
+
}) => ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare function defineEmail<P>(template: EmailTemplate<P>): EmailTemplate<P>;
|
|
21
|
+
export interface RenderedEmail {
|
|
22
|
+
subject: string;
|
|
23
|
+
html: string;
|
|
24
|
+
text: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function renderEmail<P>(template: EmailTemplate<P>, props: P, ctx: EmailContext): Promise<RenderedEmail>;
|
|
27
|
+
export declare const textStyle: {
|
|
28
|
+
color: string;
|
|
29
|
+
fontSize: number;
|
|
30
|
+
lineHeight: string;
|
|
31
|
+
margin: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const codeStyle: {
|
|
34
|
+
backgroundColor: string;
|
|
35
|
+
borderRadius: number;
|
|
36
|
+
color: string;
|
|
37
|
+
fontFamily: string;
|
|
38
|
+
fontSize: number;
|
|
39
|
+
letterSpacing: string;
|
|
40
|
+
margin: string;
|
|
41
|
+
padding: string;
|
|
42
|
+
textAlign: 'center';
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Paragraphs in the body's text style, from words already through `t()`: a template's `Body`
|
|
46
|
+
* without JSX, so an extension's emails need no React of their own.
|
|
47
|
+
*/
|
|
48
|
+
export declare const paragraphs: (...texts: readonly string[]) => ReactNode;
|
package/dist/email.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// The API runs through tsx, which applies a tsconfig only to the product's own files, so
|
|
3
|
+
// this file names its JSX runtime itself.
|
|
4
|
+
/** @jsxRuntime automatic */
|
|
5
|
+
/** @jsxImportSource react */
|
|
6
|
+
import { isRtl } from '@buffcore/i18n';
|
|
7
|
+
import { Body, Container, Head, Hr, Html, Preview, render, Section, Text, } from '@react-email/components';
|
|
8
|
+
export function defineEmail(template) {
|
|
9
|
+
return template;
|
|
10
|
+
}
|
|
11
|
+
const page = {
|
|
12
|
+
backgroundColor: '#f6f7f9',
|
|
13
|
+
fontFamily: '"Public Sans", "Noto Sans", Arial, sans-serif',
|
|
14
|
+
margin: 0,
|
|
15
|
+
};
|
|
16
|
+
const card = {
|
|
17
|
+
backgroundColor: '#ffffff',
|
|
18
|
+
borderRadius: 14,
|
|
19
|
+
border: '1px solid #e3e6ea',
|
|
20
|
+
margin: '32px auto',
|
|
21
|
+
maxWidth: 520,
|
|
22
|
+
padding: 32,
|
|
23
|
+
};
|
|
24
|
+
const footer = { color: '#5c6470', fontSize: 13, lineHeight: '20px', margin: 0 };
|
|
25
|
+
/** One plain layout for every email: quiet, readable, right-to-left aware. */
|
|
26
|
+
function Layout({ ctx, preview, children, }) {
|
|
27
|
+
return (_jsxs(Html, { lang: ctx.locale, dir: isRtl(ctx.locale) ? 'rtl' : 'ltr', children: [_jsx(Head, {}), preview ? _jsx(Preview, { children: preview }) : null, _jsx(Body, { style: page, children: _jsxs(Container, { style: card, children: [children, _jsx(Hr, { style: { borderColor: '#e3e6ea', margin: '24px 0' } }), _jsx(Section, { children: _jsx(Text, { style: footer, children: ctx.t('emails.footer.sentBy', { product: ctx.productName }) }) })] }) })] }));
|
|
28
|
+
}
|
|
29
|
+
export async function renderEmail(template, props, ctx) {
|
|
30
|
+
const preview = template.preview?.(props, ctx);
|
|
31
|
+
const element = (_jsx(Layout, { ctx: ctx, ...(preview ? { preview } : {}), children: _jsx(template.Body, { ...props, ctx: ctx }) }));
|
|
32
|
+
return {
|
|
33
|
+
subject: template.subject(props, ctx),
|
|
34
|
+
html: await render(element),
|
|
35
|
+
text: await render(element, { plainText: true }),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export const textStyle = { color: '#1d232b', fontSize: 16, lineHeight: '24px', margin: '0 0 16px' };
|
|
39
|
+
export const codeStyle = {
|
|
40
|
+
backgroundColor: '#f1f3f5',
|
|
41
|
+
borderRadius: 10,
|
|
42
|
+
color: '#1d232b',
|
|
43
|
+
fontFamily: '"IBM Plex Mono", Consolas, monospace',
|
|
44
|
+
fontSize: 28,
|
|
45
|
+
letterSpacing: '0.2em',
|
|
46
|
+
margin: '8px 0 16px',
|
|
47
|
+
padding: '12px 16px',
|
|
48
|
+
textAlign: 'center',
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Paragraphs in the body's text style, from words already through `t()`: a template's `Body`
|
|
52
|
+
* without JSX, so an extension's emails need no React of their own.
|
|
53
|
+
*/
|
|
54
|
+
export const paragraphs = (...texts) => texts.map((text) => (_jsx(Text, { style: textStyle, children: text }, text)));
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Catalog } from '@buffcore/i18n';
|
|
2
|
+
export { codeStyle, defineEmail, type EmailContext, type EmailTemplate, paragraphs, type RenderedEmail, renderEmail, textStyle, } from './email.tsx';
|
|
3
|
+
export * from './templates/alerts.tsx';
|
|
4
|
+
export * from './templates/automation.tsx';
|
|
5
|
+
export { consentReceipt } from './templates/consent.tsx';
|
|
6
|
+
export { pinChanged } from './templates/devices.tsx';
|
|
7
|
+
export { errorAlert } from './templates/errors.tsx';
|
|
8
|
+
export { accountExists, accountInvite, signInCode } from './templates/identity.tsx';
|
|
9
|
+
export * from './templates/inbox.tsx';
|
|
10
|
+
export * from './templates/password.tsx';
|
|
11
|
+
export * from './templates/privacy.tsx';
|
|
12
|
+
export declare const emailsCatalog: Catalog;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { mergeCatalogs } from '@buffcore/i18n';
|
|
2
|
+
import alertsEn from './locales/alerts.en.js';
|
|
3
|
+
import alertsEs from './locales/alerts.es.json' with { type: 'json' };
|
|
4
|
+
import automationEn from './locales/automation.en.js';
|
|
5
|
+
import automationEs from './locales/automation.es.json' with { type: 'json' };
|
|
6
|
+
import consentEn from './locales/consent.en.js';
|
|
7
|
+
import consentEs from './locales/consent.es.json' with { type: 'json' };
|
|
8
|
+
import devicesEn from './locales/devices.en.js';
|
|
9
|
+
import devicesEs from './locales/devices.es.json' with { type: 'json' };
|
|
10
|
+
import en from './locales/en.js';
|
|
11
|
+
import errorsEn from './locales/errors.en.js';
|
|
12
|
+
import errorsEs from './locales/errors.es.json' with { type: 'json' };
|
|
13
|
+
import es from './locales/es.json' with { type: 'json' };
|
|
14
|
+
import identityEn from './locales/identity.en.js';
|
|
15
|
+
import identityEs from './locales/identity.es.json' with { type: 'json' };
|
|
16
|
+
import inboxEn from './locales/inbox.en.js';
|
|
17
|
+
import inboxEs from './locales/inbox.es.json' with { type: 'json' };
|
|
18
|
+
import passwordEn from './locales/password.en.js';
|
|
19
|
+
import passwordEs from './locales/password.es.json' with { type: 'json' };
|
|
20
|
+
import privacyEn from './locales/privacy.en.js';
|
|
21
|
+
import privacyEs from './locales/privacy.es.json' with { type: 'json' };
|
|
22
|
+
export { codeStyle, defineEmail, paragraphs, renderEmail, textStyle, } from './email.js';
|
|
23
|
+
export * from './templates/alerts.js';
|
|
24
|
+
export * from './templates/automation.js';
|
|
25
|
+
export { consentReceipt } from './templates/consent.js';
|
|
26
|
+
export { pinChanged } from './templates/devices.js';
|
|
27
|
+
export { errorAlert } from './templates/errors.js';
|
|
28
|
+
export { accountExists, accountInvite, signInCode } from './templates/identity.js';
|
|
29
|
+
export * from './templates/inbox.js';
|
|
30
|
+
export * from './templates/password.js';
|
|
31
|
+
export * from './templates/privacy.js';
|
|
32
|
+
/**
|
|
33
|
+
* Each area's templates live in `templates/<area>.tsx`, with their strings in
|
|
34
|
+
* `locales/<area>.en.ts` and `<area>.es.json`, so no two slices edit the same file. To add an
|
|
35
|
+
* area: write the three files, export its templates above, and add its catalog to the list.
|
|
36
|
+
* v0.6's areas (`password`, `inbox`, `automation`) are exported whole, so their slices add
|
|
37
|
+
* templates without touching this file.
|
|
38
|
+
*/
|
|
39
|
+
const areas = [
|
|
40
|
+
{ en: identityEn, es: identityEs },
|
|
41
|
+
{ en: errorsEn, es: errorsEs },
|
|
42
|
+
{ en: consentEn, es: consentEs },
|
|
43
|
+
{ en: passwordEn, es: passwordEs },
|
|
44
|
+
{ en: inboxEn, es: inboxEs },
|
|
45
|
+
{ en: automationEn, es: automationEs },
|
|
46
|
+
{ en: devicesEn, es: devicesEs },
|
|
47
|
+
{ en: privacyEn, es: privacyEs },
|
|
48
|
+
{ en: alertsEn, es: alertsEs },
|
|
49
|
+
];
|
|
50
|
+
/** The strings of BuffCore's core emails, in English and Spanish. */
|
|
51
|
+
const merged = mergeCatalogs([{ en, es }, ...areas]);
|
|
52
|
+
export const emailsCatalog = { ...merged, en: merged.en ?? en };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operator alerts (BR4): the urgent notice and its recovery notice (email and push), the daily
|
|
3
|
+
* digest, and the names of BuffCore's own Status lines. The English source.
|
|
4
|
+
*/
|
|
5
|
+
declare const _default: {
|
|
6
|
+
'emails.alerts.open': string;
|
|
7
|
+
'emails.alerts.urgent.subject': string;
|
|
8
|
+
'emails.alerts.urgent.body': string;
|
|
9
|
+
'emails.alerts.urgent.next': string;
|
|
10
|
+
'emails.alerts.urgent.pushTitle': string;
|
|
11
|
+
'emails.alerts.urgent.pushBody': string;
|
|
12
|
+
'emails.alerts.recovered.subject': string;
|
|
13
|
+
'emails.alerts.recovered.body': string;
|
|
14
|
+
'emails.alerts.recovered.next': string;
|
|
15
|
+
'emails.alerts.recovered.pushTitle': string;
|
|
16
|
+
'emails.alerts.recovered.pushBody': string;
|
|
17
|
+
'emails.alerts.digest.subject': string;
|
|
18
|
+
'emails.alerts.digest.intro': string;
|
|
19
|
+
'emails.alerts.digest.item': string;
|
|
20
|
+
'emails.alerts.digest.itemOpen': string;
|
|
21
|
+
'emails.alerts.digest.status': string;
|
|
22
|
+
'emails.alerts.line.api': string;
|
|
23
|
+
'emails.alerts.line.worker': string;
|
|
24
|
+
'emails.alerts.line.database': string;
|
|
25
|
+
'emails.alerts.line.redis': string;
|
|
26
|
+
'emails.alerts.line.email': string;
|
|
27
|
+
'emails.alerts.line.push': string;
|
|
28
|
+
'emails.alerts.line.backup': string;
|
|
29
|
+
'emails.alerts.line.restore_test': string;
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operator alerts (BR4): the urgent notice and its recovery notice (email and push), the daily
|
|
3
|
+
* digest, and the names of BuffCore's own Status lines. The English source.
|
|
4
|
+
*/
|
|
5
|
+
export default {
|
|
6
|
+
'emails.alerts.open': 'What happened, and what to check: {link}',
|
|
7
|
+
'emails.alerts.urgent.subject': '{product}: {state, select, down {{name} is down} degraded {{name} is degraded} other {{name} isn’t reporting}}',
|
|
8
|
+
'emails.alerts.urgent.body': '{state, select, down {{name} went down at {from}.} degraded {{name} has been degraded since {from}.} other {{name} stopped reporting at {from}.}}',
|
|
9
|
+
'emails.alerts.urgent.next': 'You’ll get one more message when it recovers, and nothing else about it until then.',
|
|
10
|
+
'emails.alerts.urgent.pushTitle': '{state, select, down {{name} is down} degraded {{name} is degraded} other {{name} isn’t reporting}}',
|
|
11
|
+
'emails.alerts.urgent.pushBody': 'Since {from}. Open it to see what to check.',
|
|
12
|
+
'emails.alerts.recovered.subject': '{product}: {name} is healthy again',
|
|
13
|
+
'emails.alerts.recovered.body': '{name} is healthy again since {to}. {state, select, down {It went down} degraded {It became degraded} other {It stopped reporting}} at {from}.',
|
|
14
|
+
'emails.alerts.recovered.next': 'Nothing more to do unless it happens again.',
|
|
15
|
+
'emails.alerts.recovered.pushTitle': '{name} is healthy again',
|
|
16
|
+
'emails.alerts.recovered.pushBody': 'Since {to}.',
|
|
17
|
+
'emails.alerts.digest.subject': '{product}: {count, plural, one {# incident} other {# incidents}} on {day}',
|
|
18
|
+
'emails.alerts.digest.intro': 'What went wrong on {day}:',
|
|
19
|
+
'emails.alerts.digest.item': '{name}: {state, select, down {down} degraded {degraded} other {not reporting}} from {from} to {to}.',
|
|
20
|
+
'emails.alerts.digest.itemOpen': '{name}: {state, select, down {down} degraded {degraded} other {not reporting}} since {from}, not recovered yet.',
|
|
21
|
+
'emails.alerts.digest.status': 'Everything as it is now: {link}',
|
|
22
|
+
'emails.alerts.line.api': 'API',
|
|
23
|
+
'emails.alerts.line.worker': 'Worker',
|
|
24
|
+
'emails.alerts.line.database': 'Database',
|
|
25
|
+
'emails.alerts.line.redis': 'Redis',
|
|
26
|
+
'emails.alerts.line.email': 'Email',
|
|
27
|
+
'emails.alerts.line.push': 'Push notifications',
|
|
28
|
+
'emails.alerts.line.backup': 'Backups',
|
|
29
|
+
'emails.alerts.line.restore_test': 'Restore tests',
|
|
30
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"emails.alerts.open": "Qué pasó y qué revisar: {link}",
|
|
3
|
+
"emails.alerts.urgent.subject": "{product}: {state, select, down {{name} está caído} degraded {{name} está degradado} other {{name} no informa}}",
|
|
4
|
+
"emails.alerts.urgent.body": "{state, select, down {{name} cayó a las {from}.} degraded {{name} está degradado desde {from}.} other {{name} dejó de informar a las {from}.}}",
|
|
5
|
+
"emails.alerts.urgent.next": "Recibirás un mensaje más cuando se recupere, y nada más sobre esto hasta entonces.",
|
|
6
|
+
"emails.alerts.urgent.pushTitle": "{state, select, down {{name} está caído} degraded {{name} está degradado} other {{name} no informa}}",
|
|
7
|
+
"emails.alerts.urgent.pushBody": "Desde {from}. Ábrela para ver qué revisar.",
|
|
8
|
+
"emails.alerts.recovered.subject": "{product}: {name} vuelve a estar bien",
|
|
9
|
+
"emails.alerts.recovered.body": "{name} vuelve a estar bien desde {to}. {state, select, down {Cayó} degraded {Se degradó} other {Dejó de informar}} a las {from}.",
|
|
10
|
+
"emails.alerts.recovered.next": "No hay nada más que hacer salvo que vuelva a pasar.",
|
|
11
|
+
"emails.alerts.recovered.pushTitle": "{name} vuelve a estar bien",
|
|
12
|
+
"emails.alerts.recovered.pushBody": "Desde {to}.",
|
|
13
|
+
"emails.alerts.digest.subject": "{product}: {count, plural, one {# incidente} other {# incidentes}} el {day}",
|
|
14
|
+
"emails.alerts.digest.intro": "Lo que falló el {day}:",
|
|
15
|
+
"emails.alerts.digest.item": "{name}: {state, select, down {caído} degraded {degradado} other {sin informar}} de {from} a {to}.",
|
|
16
|
+
"emails.alerts.digest.itemOpen": "{name}: {state, select, down {caído} degraded {degradado} other {sin informar}} desde {from}, aún sin recuperarse.",
|
|
17
|
+
"emails.alerts.digest.status": "Todo como está ahora: {link}",
|
|
18
|
+
"emails.alerts.line.api": "API",
|
|
19
|
+
"emails.alerts.line.worker": "Proceso de tareas",
|
|
20
|
+
"emails.alerts.line.database": "Base de datos",
|
|
21
|
+
"emails.alerts.line.redis": "Redis",
|
|
22
|
+
"emails.alerts.line.email": "Correo",
|
|
23
|
+
"emails.alerts.line.push": "Notificaciones push",
|
|
24
|
+
"emails.alerts.line.backup": "Copias de seguridad",
|
|
25
|
+
"emails.alerts.line.restore_test": "Pruebas de restauración"
|
|
26
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Automation emails (the weekly summary, v0.6): the English source. */
|
|
2
|
+
declare const _default: {
|
|
3
|
+
'emails.weeklySummary.subject': string;
|
|
4
|
+
'emails.weeklySummary.intro': string;
|
|
5
|
+
'emails.weeklySummary.numbersOnly': string;
|
|
6
|
+
'emails.weeklySummary.activeUsers': string;
|
|
7
|
+
'emails.weeklySummary.sessions': string;
|
|
8
|
+
'emails.weeklySummary.reports': string;
|
|
9
|
+
'emails.weeklySummary.flags': string;
|
|
10
|
+
'emails.weeklySummary.waiting': string;
|
|
11
|
+
'emails.weeklySummary.aiCost': string;
|
|
12
|
+
'emails.weeklySummary.newErrors': string;
|
|
13
|
+
'emails.weeklySummary.backups': string;
|
|
14
|
+
'emails.weeklySummary.drafts': string;
|
|
15
|
+
'emails.weeklySummary.open': string;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Automation emails (the weekly summary, v0.6): the English source. */
|
|
2
|
+
export default {
|
|
3
|
+
'emails.weeklySummary.subject': 'Your week in {product}: {from} to {to}',
|
|
4
|
+
'emails.weeklySummary.intro': 'Here is last week in {product}, {from} to {to}.',
|
|
5
|
+
'emails.weeklySummary.numbersOnly': 'This week, the numbers alone: no summary was written.',
|
|
6
|
+
'emails.weeklySummary.activeUsers': 'Active people: {count, number}',
|
|
7
|
+
'emails.weeklySummary.sessions': 'Live sessions: {count, number}',
|
|
8
|
+
'emails.weeklySummary.reports': 'Reports: {count, number}',
|
|
9
|
+
'emails.weeklySummary.flags': 'Flags raised: {count, number} ({high, number} high)',
|
|
10
|
+
'emails.weeklySummary.waiting': 'Waiting in the inbox: {count, number}',
|
|
11
|
+
'emails.weeklySummary.aiCost': 'AI cost: {amount}',
|
|
12
|
+
'emails.weeklySummary.newErrors': 'New kinds of error: {count, number}',
|
|
13
|
+
'emails.weeklySummary.backups': 'Backups and restore tests: {ok, number} worked, {failed, number} failed',
|
|
14
|
+
'emails.weeklySummary.drafts': 'AI drafts: {approved, number} approved, {edited, number} edited, {rejected, number} rejected',
|
|
15
|
+
'emails.weeklySummary.open': 'Open the Overview: {link}',
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"emails.weeklySummary.subject": "Tu semana en {product}: del {from} al {to}",
|
|
3
|
+
"emails.weeklySummary.intro": "Así fue la semana pasada en {product}, del {from} al {to}.",
|
|
4
|
+
"emails.weeklySummary.numbersOnly": "Esta semana, solo los números: no se escribió ningún resumen.",
|
|
5
|
+
"emails.weeklySummary.activeUsers": "Personas activas: {count, number}",
|
|
6
|
+
"emails.weeklySummary.sessions": "Sesiones en vivo: {count, number}",
|
|
7
|
+
"emails.weeklySummary.reports": "Informes: {count, number}",
|
|
8
|
+
"emails.weeklySummary.flags": "Avisos: {count, number} ({high, number} de gravedad alta)",
|
|
9
|
+
"emails.weeklySummary.waiting": "Esperando en la bandeja: {count, number}",
|
|
10
|
+
"emails.weeklySummary.aiCost": "Costo de IA: {amount}",
|
|
11
|
+
"emails.weeklySummary.newErrors": "Tipos de error nuevos: {count, number}",
|
|
12
|
+
"emails.weeklySummary.backups": "Copias de seguridad y pruebas de restauración: {ok, number} bien, {failed, number} con fallos",
|
|
13
|
+
"emails.weeklySummary.drafts": "Borradores de IA: {approved, number} aprobados, {edited, number} editados, {rejected, number} rechazados",
|
|
14
|
+
"emails.weeklySummary.open": "Abre el Resumen: {link}"
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Consent emails (the receipt): the English source. */
|
|
2
|
+
declare const _default: {
|
|
3
|
+
'emails.consentReceipt.subject': string;
|
|
4
|
+
'emails.consentReceipt.preview': string;
|
|
5
|
+
'emails.consentReceipt.intro': string;
|
|
6
|
+
'emails.consentReceipt.for': string;
|
|
7
|
+
'emails.consentReceipt.when': string;
|
|
8
|
+
'emails.consentReceipt.version': string;
|
|
9
|
+
'emails.consentReceipt.withdraw': string;
|
|
10
|
+
'emails.consentReceipt.keep': string;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Consent emails (the receipt): the English source. */
|
|
2
|
+
export default {
|
|
3
|
+
'emails.consentReceipt.subject': 'Your consent receipt from {product}',
|
|
4
|
+
'emails.consentReceipt.preview': 'You agreed to: {title}',
|
|
5
|
+
'emails.consentReceipt.intro': 'This confirms the consent you gave:',
|
|
6
|
+
'emails.consentReceipt.for': 'For: {name}',
|
|
7
|
+
'emails.consentReceipt.when': 'Given on {when}.',
|
|
8
|
+
'emails.consentReceipt.version': 'You read version {version, number} of the text, in {language}.',
|
|
9
|
+
'emails.consentReceipt.withdraw': 'You can withdraw it at any time in your account settings in {product}.',
|
|
10
|
+
'emails.consentReceipt.keep': 'Keep this email for your records.',
|
|
11
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"emails.consentReceipt.subject": "Tu comprobante de consentimiento de {product}",
|
|
3
|
+
"emails.consentReceipt.preview": "Aceptaste: {title}",
|
|
4
|
+
"emails.consentReceipt.intro": "Confirmamos el consentimiento que diste:",
|
|
5
|
+
"emails.consentReceipt.for": "Para: {name}",
|
|
6
|
+
"emails.consentReceipt.when": "Dado el {when}.",
|
|
7
|
+
"emails.consentReceipt.version": "Leíste la versión {version, number} del texto, en {language}.",
|
|
8
|
+
"emails.consentReceipt.withdraw": "Puedes retirarlo cuando quieras en la configuración de tu cuenta de {product}.",
|
|
9
|
+
"emails.consentReceipt.keep": "Guarda este correo para tus registros."
|
|
10
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Devices emails (the PIN changed): the English source. */
|
|
2
|
+
export default {
|
|
3
|
+
'emails.pinChanged.subject': 'Your {product} PIN was changed',
|
|
4
|
+
'emails.pinChanged.intro': 'The PIN that guards profile mode on your devices was changed on {when}.',
|
|
5
|
+
'emails.pinChanged.notYou': "If you didn't change it, sign in to {product} and set a new PIN, then change your password.",
|
|
6
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"emails.pinChanged.subject": "Se cambió tu PIN de {product}",
|
|
3
|
+
"emails.pinChanged.intro": "El PIN que protege el modo de perfiles en tus dispositivos se cambió el {when}.",
|
|
4
|
+
"emails.pinChanged.notYou": "Si no lo cambiaste tú, inicia sesión en {product} y crea un PIN nuevo; luego cambia tu contraseña."
|
|
5
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Errors emails (the alert to the Owner): the English source. */
|
|
2
|
+
declare const _default: {
|
|
3
|
+
'emails.errorAlert.subjectNew': string;
|
|
4
|
+
'emails.errorAlert.subjectBack': string;
|
|
5
|
+
'emails.errorAlert.introNew': string;
|
|
6
|
+
'emails.errorAlert.introBack': string;
|
|
7
|
+
'emails.errorAlert.where': string;
|
|
8
|
+
'emails.errorAlert.open': string;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Errors emails (the alert to the Owner): the English source. */
|
|
2
|
+
export default {
|
|
3
|
+
'emails.errorAlert.subjectNew': 'New error in {product}',
|
|
4
|
+
'emails.errorAlert.subjectBack': 'An error came back in {product}',
|
|
5
|
+
'emails.errorAlert.introNew': 'A new kind of error happened:',
|
|
6
|
+
'emails.errorAlert.introBack': 'An error you resolved happened again:',
|
|
7
|
+
'emails.errorAlert.where': 'Where: {where}. Seen {count, plural, one {# time} other {# times}}.',
|
|
8
|
+
'emails.errorAlert.open': 'Open it in the admin console: {link}',
|
|
9
|
+
};
|