@resq-systems/email-templates 0.3.0
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 +236 -0
- package/lib/contract.d.ts +125 -0
- package/lib/contract.d.ts.map +1 -0
- package/lib/contract.js +29 -0
- package/lib/contract.js.map +1 -0
- package/lib/emails/incident-alert.d.ts +8 -0
- package/lib/emails/incident-alert.d.ts.map +1 -0
- package/lib/emails/incident-alert.js +44 -0
- package/lib/emails/incident-alert.js.map +1 -0
- package/lib/emails/index.d.ts +13 -0
- package/lib/emails/index.js +13 -0
- package/lib/emails/mission-approval.d.ts +8 -0
- package/lib/emails/mission-approval.d.ts.map +1 -0
- package/lib/emails/mission-approval.js +46 -0
- package/lib/emails/mission-approval.js.map +1 -0
- package/lib/emails/new-device-login.d.ts +8 -0
- package/lib/emails/new-device-login.d.ts.map +1 -0
- package/lib/emails/new-device-login.js +47 -0
- package/lib/emails/new-device-login.js.map +1 -0
- package/lib/emails/notification.d.ts +8 -0
- package/lib/emails/notification.d.ts.map +1 -0
- package/lib/emails/notification.js +33 -0
- package/lib/emails/notification.js.map +1 -0
- package/lib/emails/org-invitation.d.ts +8 -0
- package/lib/emails/org-invitation.d.ts.map +1 -0
- package/lib/emails/org-invitation.js +41 -0
- package/lib/emails/org-invitation.js.map +1 -0
- package/lib/emails/otp.d.ts +11 -0
- package/lib/emails/otp.d.ts.map +1 -0
- package/lib/emails/otp.js +37 -0
- package/lib/emails/otp.js.map +1 -0
- package/lib/emails/password-changed.d.ts +8 -0
- package/lib/emails/password-changed.d.ts.map +1 -0
- package/lib/emails/password-changed.js +36 -0
- package/lib/emails/password-changed.js.map +1 -0
- package/lib/emails/password-reset.d.ts +8 -0
- package/lib/emails/password-reset.d.ts.map +1 -0
- package/lib/emails/password-reset.js +37 -0
- package/lib/emails/password-reset.js.map +1 -0
- package/lib/emails/primitives.d.ts +94 -0
- package/lib/emails/primitives.d.ts.map +1 -0
- package/lib/emails/primitives.js +233 -0
- package/lib/emails/primitives.js.map +1 -0
- package/lib/emails/theme.d.ts +89 -0
- package/lib/emails/theme.d.ts.map +1 -0
- package/lib/emails/theme.js +93 -0
- package/lib/emails/theme.js.map +1 -0
- package/lib/emails/tokens.d.ts +65 -0
- package/lib/emails/tokens.d.ts.map +1 -0
- package/lib/emails/tokens.js +46 -0
- package/lib/emails/tokens.js.map +1 -0
- package/lib/emails/welcome.d.ts +8 -0
- package/lib/emails/welcome.d.ts.map +1 -0
- package/lib/emails/welcome.js +32 -0
- package/lib/emails/welcome.js.map +1 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +8 -0
- package/lib/mailer.d.ts +89 -0
- package/lib/mailer.d.ts.map +1 -0
- package/lib/mailer.js +85 -0
- package/lib/mailer.js.map +1 -0
- package/lib/node_modules/@react-email/tailwind/dist/index.d.ts +9 -0
- package/lib/node_modules/@react-email/tailwind/dist/index.d.ts.map +1 -0
- package/lib/node_modules/tailwindcss/dist/colors.d.ts +349 -0
- package/lib/node_modules/tailwindcss/dist/colors.d.ts.map +1 -0
- package/lib/node_modules/tailwindcss/dist/lib.d.ts +6 -0
- package/lib/node_modules/tailwindcss/dist/lib.d.ts.map +1 -0
- package/lib/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.ts +29 -0
- package/lib/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.ts.map +1 -0
- package/lib/node_modules/tailwindcss/dist/types-DWdTiksJ.d.ts +126 -0
- package/lib/node_modules/tailwindcss/dist/types-DWdTiksJ.d.ts.map +1 -0
- package/lib/registry.d.ts +25 -0
- package/lib/registry.d.ts.map +1 -0
- package/lib/registry.js +26 -0
- package/lib/registry.js.map +1 -0
- package/lib/render.d.ts +13 -0
- package/lib/render.d.ts.map +1 -0
- package/lib/render.js +29 -0
- package/lib/render.js.map +1 -0
- package/lib/schemas.d.ts +86 -0
- package/lib/schemas.d.ts.map +1 -0
- package/lib/schemas.js +104 -0
- package/lib/schemas.js.map +1 -0
- package/lib/send/index.d.ts +4 -0
- package/lib/send/index.js +3 -0
- package/lib/send/resend-sender.d.ts +14 -0
- package/lib/send/resend-sender.d.ts.map +1 -0
- package/lib/send/resend-sender.js +76 -0
- package/lib/send/resend-sender.js.map +1 -0
- package/lib/send/send-email.d.ts +19 -0
- package/lib/send/send-email.d.ts.map +1 -0
- package/lib/send/send-email.js +67 -0
- package/lib/send/send-email.js.map +1 -0
- package/lib/send/sender.d.ts +58 -0
- package/lib/send/sender.d.ts.map +1 -0
- package/lib/send/sender.js +0 -0
- package/lib/suite.d.ts +130 -0
- package/lib/suite.d.ts.map +1 -0
- package/lib/suite.js +28 -0
- package/lib/suite.js.map +1 -0
- package/lib/templates.d.ts +131 -0
- package/lib/templates.d.ts.map +1 -0
- package/lib/templates.js +98 -0
- package/lib/templates.js.map +1 -0
- package/package.json +95 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { EmailTemplateDef } from "./mailer.js";
|
|
2
|
+
//#region src/templates.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Copyright 2026 ResQ Systems, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
declare const otpTemplate: EmailTemplateDef<"otp", import("effect/Schema").Struct<{
|
|
19
|
+
readonly code: import("effect/Schema").NonEmptyString;
|
|
20
|
+
readonly firstName: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
21
|
+
readonly expiresInMinutes: import("effect/Schema").optional<import("effect/Schema").Number>;
|
|
22
|
+
}>>;
|
|
23
|
+
declare const welcomeTemplate: EmailTemplateDef<"welcome", import("effect/Schema").Struct<{
|
|
24
|
+
readonly firstName: import("effect/Schema").NonEmptyString;
|
|
25
|
+
readonly verifyUrl: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
26
|
+
}>>;
|
|
27
|
+
declare const passwordResetTemplate: EmailTemplateDef<"password-reset", import("effect/Schema").Struct<{
|
|
28
|
+
readonly firstName: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
29
|
+
readonly resetUrl: import("effect/Schema").String;
|
|
30
|
+
readonly expiresInMinutes: import("effect/Schema").optional<import("effect/Schema").Number>;
|
|
31
|
+
}>>;
|
|
32
|
+
declare const notificationTemplate: EmailTemplateDef<"notification", import("effect/Schema").Struct<{
|
|
33
|
+
readonly title: import("effect/Schema").NonEmptyString;
|
|
34
|
+
readonly body: import("effect/Schema").NonEmptyString;
|
|
35
|
+
readonly severity: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["info", "success", "warning", "error"]>>;
|
|
36
|
+
readonly actionUrl: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
37
|
+
readonly actionLabel: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
38
|
+
}>>;
|
|
39
|
+
declare const incidentAlertTemplate: EmailTemplateDef<"incident-alert", import("effect/Schema").Struct<{
|
|
40
|
+
readonly incidentId: import("effect/Schema").NonEmptyString;
|
|
41
|
+
readonly title: import("effect/Schema").NonEmptyString;
|
|
42
|
+
readonly severity: import("effect/Schema").Literals<readonly ["info", "warning", "critical"]>;
|
|
43
|
+
readonly summary: import("effect/Schema").NonEmptyString;
|
|
44
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
45
|
+
readonly detectedAt: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
46
|
+
readonly dashboardUrl: import("effect/Schema").String;
|
|
47
|
+
}>>;
|
|
48
|
+
declare const passwordChangedTemplate: EmailTemplateDef<"password-changed", import("effect/Schema").Struct<{
|
|
49
|
+
readonly firstName: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
50
|
+
readonly changedAt: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
51
|
+
readonly secureAccountUrl: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
52
|
+
}>>;
|
|
53
|
+
declare const newDeviceLoginTemplate: EmailTemplateDef<"new-device-login", import("effect/Schema").Struct<{
|
|
54
|
+
readonly firstName: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
55
|
+
readonly device: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
56
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
57
|
+
readonly ipAddress: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
58
|
+
readonly at: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
59
|
+
readonly secureAccountUrl: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
60
|
+
}>>;
|
|
61
|
+
declare const missionApprovalTemplate: EmailTemplateDef<"mission-approval", import("effect/Schema").Struct<{
|
|
62
|
+
readonly missionId: import("effect/Schema").NonEmptyString;
|
|
63
|
+
readonly title: import("effect/Schema").NonEmptyString;
|
|
64
|
+
readonly summary: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
65
|
+
readonly requestedBy: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
66
|
+
readonly severity: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["info", "warning", "critical"]>>;
|
|
67
|
+
readonly approveUrl: import("effect/Schema").String;
|
|
68
|
+
readonly expiresInMinutes: import("effect/Schema").optional<import("effect/Schema").Number>;
|
|
69
|
+
}>>;
|
|
70
|
+
declare const orgInvitationTemplate: EmailTemplateDef<"org-invitation", import("effect/Schema").Struct<{
|
|
71
|
+
readonly orgName: import("effect/Schema").NonEmptyString;
|
|
72
|
+
readonly inviterName: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
73
|
+
readonly orgRole: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
74
|
+
readonly acceptUrl: import("effect/Schema").String;
|
|
75
|
+
readonly expiresInDays: import("effect/Schema").optional<import("effect/Schema").Number>;
|
|
76
|
+
}>>;
|
|
77
|
+
/** The built-in ResQ Systems template set — spread into `createMailer` to extend it. */
|
|
78
|
+
declare const resqEmailTemplates: readonly [EmailTemplateDef<"otp", import("effect/Schema").Struct<{
|
|
79
|
+
readonly code: import("effect/Schema").NonEmptyString;
|
|
80
|
+
readonly firstName: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
81
|
+
readonly expiresInMinutes: import("effect/Schema").optional<import("effect/Schema").Number>;
|
|
82
|
+
}>>, EmailTemplateDef<"welcome", import("effect/Schema").Struct<{
|
|
83
|
+
readonly firstName: import("effect/Schema").NonEmptyString;
|
|
84
|
+
readonly verifyUrl: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
85
|
+
}>>, EmailTemplateDef<"password-reset", import("effect/Schema").Struct<{
|
|
86
|
+
readonly firstName: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
87
|
+
readonly resetUrl: import("effect/Schema").String;
|
|
88
|
+
readonly expiresInMinutes: import("effect/Schema").optional<import("effect/Schema").Number>;
|
|
89
|
+
}>>, EmailTemplateDef<"notification", import("effect/Schema").Struct<{
|
|
90
|
+
readonly title: import("effect/Schema").NonEmptyString;
|
|
91
|
+
readonly body: import("effect/Schema").NonEmptyString;
|
|
92
|
+
readonly severity: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["info", "success", "warning", "error"]>>;
|
|
93
|
+
readonly actionUrl: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
94
|
+
readonly actionLabel: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
95
|
+
}>>, EmailTemplateDef<"incident-alert", import("effect/Schema").Struct<{
|
|
96
|
+
readonly incidentId: import("effect/Schema").NonEmptyString;
|
|
97
|
+
readonly title: import("effect/Schema").NonEmptyString;
|
|
98
|
+
readonly severity: import("effect/Schema").Literals<readonly ["info", "warning", "critical"]>;
|
|
99
|
+
readonly summary: import("effect/Schema").NonEmptyString;
|
|
100
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
101
|
+
readonly detectedAt: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
102
|
+
readonly dashboardUrl: import("effect/Schema").String;
|
|
103
|
+
}>>, EmailTemplateDef<"password-changed", import("effect/Schema").Struct<{
|
|
104
|
+
readonly firstName: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
105
|
+
readonly changedAt: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
106
|
+
readonly secureAccountUrl: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
107
|
+
}>>, EmailTemplateDef<"new-device-login", import("effect/Schema").Struct<{
|
|
108
|
+
readonly firstName: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
109
|
+
readonly device: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
110
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
111
|
+
readonly ipAddress: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
112
|
+
readonly at: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
113
|
+
readonly secureAccountUrl: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
114
|
+
}>>, EmailTemplateDef<"mission-approval", import("effect/Schema").Struct<{
|
|
115
|
+
readonly missionId: import("effect/Schema").NonEmptyString;
|
|
116
|
+
readonly title: import("effect/Schema").NonEmptyString;
|
|
117
|
+
readonly summary: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
118
|
+
readonly requestedBy: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
119
|
+
readonly severity: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["info", "warning", "critical"]>>;
|
|
120
|
+
readonly approveUrl: import("effect/Schema").String;
|
|
121
|
+
readonly expiresInMinutes: import("effect/Schema").optional<import("effect/Schema").Number>;
|
|
122
|
+
}>>, EmailTemplateDef<"org-invitation", import("effect/Schema").Struct<{
|
|
123
|
+
readonly orgName: import("effect/Schema").NonEmptyString;
|
|
124
|
+
readonly inviterName: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
125
|
+
readonly orgRole: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
126
|
+
readonly acceptUrl: import("effect/Schema").String;
|
|
127
|
+
readonly expiresInDays: import("effect/Schema").optional<import("effect/Schema").Number>;
|
|
128
|
+
}>>];
|
|
129
|
+
//#endregion
|
|
130
|
+
export { incidentAlertTemplate, missionApprovalTemplate, newDeviceLoginTemplate, notificationTemplate, orgInvitationTemplate, otpTemplate, passwordChangedTemplate, passwordResetTemplate, resqEmailTemplates, welcomeTemplate };
|
|
131
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","names":[],"sources":["../src/templates.tsx"],"mappings":";;;;;;;;;;;;;;;;;cAsCa,aAAA,gDAAW;;;;;cAOX,iBAAA,oDAAe;;;;cAOf,uBAAA,2DAAqB;;;;;cAOrB,sBAAA,yDAAoB;;;;;;;cAOpB,uBAAA,2DAAqB;;;;;;;;;cAOrB,yBAAA,6DAAuB;;;;;cAOvB,wBAAA,6DAAsB;;;;;;;;cAOtB,yBAAA,6DAAuB;;;;;;;;;cAOvB,uBAAA,2DAAqB;;;;;;;;cAQrB,8BAAA,gDAAkB;;;;KAAA"}
|
package/lib/templates.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { incidentAlertData, missionApprovalData, newDeviceLoginData, notificationData, orgInvitationData, otpData, passwordChangedData, passwordResetData, welcomeData } from "./schemas.js";
|
|
2
|
+
import { defineEmailTemplate } from "./mailer.js";
|
|
3
|
+
import { IncidentAlertEmail } from "./emails/incident-alert.js";
|
|
4
|
+
import { MissionApprovalEmail } from "./emails/mission-approval.js";
|
|
5
|
+
import { NewDeviceLoginEmail } from "./emails/new-device-login.js";
|
|
6
|
+
import { NotificationEmail } from "./emails/notification.js";
|
|
7
|
+
import { OrgInvitationEmail } from "./emails/org-invitation.js";
|
|
8
|
+
import { OtpEmail } from "./emails/otp.js";
|
|
9
|
+
import { PasswordChangedEmail } from "./emails/password-changed.js";
|
|
10
|
+
import { PasswordResetEmail } from "./emails/password-reset.js";
|
|
11
|
+
import { WelcomeEmail } from "./emails/welcome.js";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
//#region src/templates.tsx
|
|
14
|
+
/**
|
|
15
|
+
* Copyright 2026 ResQ Systems, Inc.
|
|
16
|
+
*
|
|
17
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License.
|
|
19
|
+
* You may obtain a copy of the License at
|
|
20
|
+
*
|
|
21
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
+
* See the License for the specific language governing permissions and
|
|
27
|
+
* limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
const otpTemplate = defineEmailTemplate({
|
|
30
|
+
name: "otp",
|
|
31
|
+
data: otpData,
|
|
32
|
+
subject: (data) => `Your ResQ Systems verification code: ${data.code}`,
|
|
33
|
+
Component: (data) => /* @__PURE__ */ jsx(OtpEmail, { ...data })
|
|
34
|
+
});
|
|
35
|
+
const welcomeTemplate = defineEmailTemplate({
|
|
36
|
+
name: "welcome",
|
|
37
|
+
data: welcomeData,
|
|
38
|
+
subject: (data) => `Welcome to ResQ Systems, ${data.firstName}`,
|
|
39
|
+
Component: (data) => /* @__PURE__ */ jsx(WelcomeEmail, { ...data })
|
|
40
|
+
});
|
|
41
|
+
const passwordResetTemplate = defineEmailTemplate({
|
|
42
|
+
name: "password-reset",
|
|
43
|
+
data: passwordResetData,
|
|
44
|
+
subject: () => "Reset your ResQ Systems password",
|
|
45
|
+
Component: (data) => /* @__PURE__ */ jsx(PasswordResetEmail, { ...data })
|
|
46
|
+
});
|
|
47
|
+
const notificationTemplate = defineEmailTemplate({
|
|
48
|
+
name: "notification",
|
|
49
|
+
data: notificationData,
|
|
50
|
+
subject: (data) => data.title,
|
|
51
|
+
Component: (data) => /* @__PURE__ */ jsx(NotificationEmail, { ...data })
|
|
52
|
+
});
|
|
53
|
+
const incidentAlertTemplate = defineEmailTemplate({
|
|
54
|
+
name: "incident-alert",
|
|
55
|
+
data: incidentAlertData,
|
|
56
|
+
subject: (data) => `[${data.severity.toUpperCase()}] ${data.title}`,
|
|
57
|
+
Component: (data) => /* @__PURE__ */ jsx(IncidentAlertEmail, { ...data })
|
|
58
|
+
});
|
|
59
|
+
const passwordChangedTemplate = defineEmailTemplate({
|
|
60
|
+
name: "password-changed",
|
|
61
|
+
data: passwordChangedData,
|
|
62
|
+
subject: () => "Your ResQ Systems password was changed",
|
|
63
|
+
Component: (data) => /* @__PURE__ */ jsx(PasswordChangedEmail, { ...data })
|
|
64
|
+
});
|
|
65
|
+
const newDeviceLoginTemplate = defineEmailTemplate({
|
|
66
|
+
name: "new-device-login",
|
|
67
|
+
data: newDeviceLoginData,
|
|
68
|
+
subject: () => "New sign-in to your ResQ Systems account",
|
|
69
|
+
Component: (data) => /* @__PURE__ */ jsx(NewDeviceLoginEmail, { ...data })
|
|
70
|
+
});
|
|
71
|
+
const missionApprovalTemplate = defineEmailTemplate({
|
|
72
|
+
name: "mission-approval",
|
|
73
|
+
data: missionApprovalData,
|
|
74
|
+
subject: (data) => `Mission approval needed: ${data.title}`,
|
|
75
|
+
Component: (data) => /* @__PURE__ */ jsx(MissionApprovalEmail, { ...data })
|
|
76
|
+
});
|
|
77
|
+
const orgInvitationTemplate = defineEmailTemplate({
|
|
78
|
+
name: "org-invitation",
|
|
79
|
+
data: orgInvitationData,
|
|
80
|
+
subject: (data) => `You're invited to join ${data.orgName} on ResQ Systems`,
|
|
81
|
+
Component: (data) => /* @__PURE__ */ jsx(OrgInvitationEmail, { ...data })
|
|
82
|
+
});
|
|
83
|
+
/** The built-in ResQ Systems template set — spread into `createMailer` to extend it. */
|
|
84
|
+
const resqEmailTemplates = [
|
|
85
|
+
otpTemplate,
|
|
86
|
+
welcomeTemplate,
|
|
87
|
+
passwordResetTemplate,
|
|
88
|
+
notificationTemplate,
|
|
89
|
+
incidentAlertTemplate,
|
|
90
|
+
passwordChangedTemplate,
|
|
91
|
+
newDeviceLoginTemplate,
|
|
92
|
+
missionApprovalTemplate,
|
|
93
|
+
orgInvitationTemplate
|
|
94
|
+
];
|
|
95
|
+
//#endregion
|
|
96
|
+
export { incidentAlertTemplate, missionApprovalTemplate, newDeviceLoginTemplate, notificationTemplate, orgInvitationTemplate, otpTemplate, passwordChangedTemplate, passwordResetTemplate, resqEmailTemplates, welcomeTemplate };
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","names":[],"sources":["../src/templates.tsx"],"sourcesContent":["/**\n * Copyright 2026 ResQ Systems, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IncidentAlertEmail } from \"./emails/incident-alert.js\";\nimport { MissionApprovalEmail } from \"./emails/mission-approval.js\";\nimport { NewDeviceLoginEmail } from \"./emails/new-device-login.js\";\nimport { NotificationEmail } from \"./emails/notification.js\";\nimport { OrgInvitationEmail } from \"./emails/org-invitation.js\";\nimport { OtpEmail } from \"./emails/otp.js\";\nimport { PasswordChangedEmail } from \"./emails/password-changed.js\";\nimport { PasswordResetEmail } from \"./emails/password-reset.js\";\nimport { WelcomeEmail } from \"./emails/welcome.js\";\nimport { defineEmailTemplate } from \"./mailer.js\";\nimport {\n\tincidentAlertData,\n\tmissionApprovalData,\n\tnewDeviceLoginData,\n\tnotificationData,\n\torgInvitationData,\n\totpData,\n\tpasswordChangedData,\n\tpasswordResetData,\n\twelcomeData,\n} from \"./schemas.js\";\n\nexport const otpTemplate = defineEmailTemplate({\n\tname: \"otp\",\n\tdata: otpData,\n\tsubject: (data) => `Your ResQ Systems verification code: ${data.code}`,\n\tComponent: (data) => <OtpEmail {...data} />,\n});\n\nexport const welcomeTemplate = defineEmailTemplate({\n\tname: \"welcome\",\n\tdata: welcomeData,\n\tsubject: (data) => `Welcome to ResQ Systems, ${data.firstName}`,\n\tComponent: (data) => <WelcomeEmail {...data} />,\n});\n\nexport const passwordResetTemplate = defineEmailTemplate({\n\tname: \"password-reset\",\n\tdata: passwordResetData,\n\tsubject: () => \"Reset your ResQ Systems password\",\n\tComponent: (data) => <PasswordResetEmail {...data} />,\n});\n\nexport const notificationTemplate = defineEmailTemplate({\n\tname: \"notification\",\n\tdata: notificationData,\n\tsubject: (data) => data.title,\n\tComponent: (data) => <NotificationEmail {...data} />,\n});\n\nexport const incidentAlertTemplate = defineEmailTemplate({\n\tname: \"incident-alert\",\n\tdata: incidentAlertData,\n\tsubject: (data) => `[${data.severity.toUpperCase()}] ${data.title}`,\n\tComponent: (data) => <IncidentAlertEmail {...data} />,\n});\n\nexport const passwordChangedTemplate = defineEmailTemplate({\n\tname: \"password-changed\",\n\tdata: passwordChangedData,\n\tsubject: () => \"Your ResQ Systems password was changed\",\n\tComponent: (data) => <PasswordChangedEmail {...data} />,\n});\n\nexport const newDeviceLoginTemplate = defineEmailTemplate({\n\tname: \"new-device-login\",\n\tdata: newDeviceLoginData,\n\tsubject: () => \"New sign-in to your ResQ Systems account\",\n\tComponent: (data) => <NewDeviceLoginEmail {...data} />,\n});\n\nexport const missionApprovalTemplate = defineEmailTemplate({\n\tname: \"mission-approval\",\n\tdata: missionApprovalData,\n\tsubject: (data) => `Mission approval needed: ${data.title}`,\n\tComponent: (data) => <MissionApprovalEmail {...data} />,\n});\n\nexport const orgInvitationTemplate = defineEmailTemplate({\n\tname: \"org-invitation\",\n\tdata: orgInvitationData,\n\tsubject: (data) => `You're invited to join ${data.orgName} on ResQ Systems`,\n\tComponent: (data) => <OrgInvitationEmail {...data} />,\n});\n\n/** The built-in ResQ Systems template set — spread into `createMailer` to extend it. */\nexport const resqEmailTemplates = [\n\totpTemplate,\n\twelcomeTemplate,\n\tpasswordResetTemplate,\n\tnotificationTemplate,\n\tincidentAlertTemplate,\n\tpasswordChangedTemplate,\n\tnewDeviceLoginTemplate,\n\tmissionApprovalTemplate,\n\torgInvitationTemplate,\n] as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAa,cAAc,oBAAoB;CAC9C,MAAM;CACN,MAAM;CACN,UAAU,SAAS,wCAAwC,KAAK;CAChE,YAAY,SAAS,oBAAC,UAAD,EAAU,GAAI,KAAO,CAAA;AAC3C,CAAC;AAED,MAAa,kBAAkB,oBAAoB;CAClD,MAAM;CACN,MAAM;CACN,UAAU,SAAS,4BAA4B,KAAK;CACpD,YAAY,SAAS,oBAAC,cAAD,EAAc,GAAI,KAAO,CAAA;AAC/C,CAAC;AAED,MAAa,wBAAwB,oBAAoB;CACxD,MAAM;CACN,MAAM;CACN,eAAe;CACf,YAAY,SAAS,oBAAC,oBAAD,EAAoB,GAAI,KAAO,CAAA;AACrD,CAAC;AAED,MAAa,uBAAuB,oBAAoB;CACvD,MAAM;CACN,MAAM;CACN,UAAU,SAAS,KAAK;CACxB,YAAY,SAAS,oBAAC,mBAAD,EAAmB,GAAI,KAAO,CAAA;AACpD,CAAC;AAED,MAAa,wBAAwB,oBAAoB;CACxD,MAAM;CACN,MAAM;CACN,UAAU,SAAS,IAAI,KAAK,SAAS,YAAY,EAAE,IAAI,KAAK;CAC5D,YAAY,SAAS,oBAAC,oBAAD,EAAoB,GAAI,KAAO,CAAA;AACrD,CAAC;AAED,MAAa,0BAA0B,oBAAoB;CAC1D,MAAM;CACN,MAAM;CACN,eAAe;CACf,YAAY,SAAS,oBAAC,sBAAD,EAAsB,GAAI,KAAO,CAAA;AACvD,CAAC;AAED,MAAa,yBAAyB,oBAAoB;CACzD,MAAM;CACN,MAAM;CACN,eAAe;CACf,YAAY,SAAS,oBAAC,qBAAD,EAAqB,GAAI,KAAO,CAAA;AACtD,CAAC;AAED,MAAa,0BAA0B,oBAAoB;CAC1D,MAAM;CACN,MAAM;CACN,UAAU,SAAS,4BAA4B,KAAK;CACpD,YAAY,SAAS,oBAAC,sBAAD,EAAsB,GAAI,KAAO,CAAA;AACvD,CAAC;AAED,MAAa,wBAAwB,oBAAoB;CACxD,MAAM;CACN,MAAM;CACN,UAAU,SAAS,0BAA0B,KAAK,QAAQ;CAC1D,YAAY,SAAS,oBAAC,oBAAD,EAAoB,GAAI,KAAO,CAAA;AACrD,CAAC;;AAGD,MAAa,qBAAqB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@resq-systems/email-templates",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Type-safe transactional email templates: an Effect Schema contract, React Email components, headless render-to-html/text, and an optional Resend sender",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "ResQ Systems, Inc."
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./lib/index.d.ts",
|
|
13
|
+
"import": "./lib/index.js",
|
|
14
|
+
"default": "./lib/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./emails": {
|
|
17
|
+
"types": "./lib/emails/index.d.ts",
|
|
18
|
+
"import": "./lib/emails/index.js",
|
|
19
|
+
"default": "./lib/emails/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./send": {
|
|
22
|
+
"types": "./lib/send/index.d.ts",
|
|
23
|
+
"import": "./lib/send/index.js",
|
|
24
|
+
"default": "./lib/send/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"main": "lib/index.js",
|
|
28
|
+
"module": "lib/index.js",
|
|
29
|
+
"types": "lib/index.d.ts",
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"files": [
|
|
32
|
+
"lib",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsdown",
|
|
37
|
+
"test": "vitest run",
|
|
38
|
+
"tsc": "tsc --noEmit",
|
|
39
|
+
"email:dev": "email dev --dir ./emails --port 3000",
|
|
40
|
+
"email:export": "email export --dir ./emails --outDir ./out --pretty --plainText"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@react-email/components": "^1.0.12",
|
|
44
|
+
"@react-email/render": "^2.0.10",
|
|
45
|
+
"@resq-systems/constants": "workspace:*"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"effect": ">=4.0.0-beta.78",
|
|
49
|
+
"react": ">=19",
|
|
50
|
+
"react-dom": ">=19",
|
|
51
|
+
"resend": ">=6"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"resend": {
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@react-email/ui": "6.6.9",
|
|
60
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
|
61
|
+
"@types/node": "^26.1.1",
|
|
62
|
+
"@types/react": "^19.2.16",
|
|
63
|
+
"@types/react-dom": "^19.2.3",
|
|
64
|
+
"@vitest/coverage-v8": "4.1.10",
|
|
65
|
+
"effect": "4.0.0-beta.97",
|
|
66
|
+
"react": "^19.2.7",
|
|
67
|
+
"react-dom": "^19.2.7",
|
|
68
|
+
"react-email": "6.6.9",
|
|
69
|
+
"resend": "6.17.2",
|
|
70
|
+
"tsdown": "^0.22.4",
|
|
71
|
+
"typescript": "7.0.2",
|
|
72
|
+
"vitest": "4.1.8"
|
|
73
|
+
},
|
|
74
|
+
"publishConfig": {
|
|
75
|
+
"access": "public",
|
|
76
|
+
"provenance": true,
|
|
77
|
+
"registry": "https://registry.npmjs.org/"
|
|
78
|
+
},
|
|
79
|
+
"repository": {
|
|
80
|
+
"type": "git",
|
|
81
|
+
"url": "git+https://github.com/resq-software/npm.git",
|
|
82
|
+
"directory": "packages/email-templates"
|
|
83
|
+
},
|
|
84
|
+
"keywords": [
|
|
85
|
+
"email",
|
|
86
|
+
"react-email",
|
|
87
|
+
"templates",
|
|
88
|
+
"transactional",
|
|
89
|
+
"effect",
|
|
90
|
+
"resend"
|
|
91
|
+
],
|
|
92
|
+
"engines": {
|
|
93
|
+
"node": ">=20.19.0"
|
|
94
|
+
}
|
|
95
|
+
}
|