@vrplatform/email 1.0.2-stage.43191896938 → 1.0.2-stage.43250811764
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/build/main/templates/Tax1099EmailTemplate.d.ts +13 -0
- package/build/main/templates/Tax1099EmailTemplate.js +61 -0
- package/build/main/templates/Tax1099EmailTemplate.js.map +1 -0
- package/build/main/templates/TeamApiTokenCreatedEmailTemplate.d.ts +10 -0
- package/build/main/templates/TeamApiTokenCreatedEmailTemplate.js +12 -0
- package/build/main/templates/TeamApiTokenCreatedEmailTemplate.js.map +1 -0
- package/build/main/templates/index.d.ts +2 -0
- package/build/main/templates/index.js +3 -0
- package/build/main/templates/index.js.map +1 -1
- package/build/module/templates/Tax1099EmailTemplate.d.ts +13 -0
- package/build/module/templates/Tax1099EmailTemplate.js +56 -0
- package/build/module/templates/Tax1099EmailTemplate.js.map +1 -0
- package/build/module/templates/TeamApiTokenCreatedEmailTemplate.d.ts +10 -0
- package/build/module/templates/TeamApiTokenCreatedEmailTemplate.js +8 -0
- package/build/module/templates/TeamApiTokenCreatedEmailTemplate.js.map +1 -0
- package/build/module/templates/index.d.ts +2 -0
- package/build/module/templates/index.js +3 -0
- package/build/module/templates/index.js.map +1 -1
- package/package.json +1 -1
- package/src/templates/Tax1099EmailTemplate.tsx +100 -0
- package/src/templates/TeamApiTokenCreatedEmailTemplate.tsx +50 -0
- package/src/templates/index.ts +4 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ActionEmailData, type ActionEmailTemplateProps } from '../components';
|
|
2
|
+
type Tax1099EmailType = 'taxInfoRequest' | 'emailDeliveryRequest' | 'tax1099Ready' | 'tax1099Corrected';
|
|
3
|
+
export declare const getDefaultTax1099EmailData: (type: Tax1099EmailType, mode: 'tag' | 'text', args: {
|
|
4
|
+
teamName: string;
|
|
5
|
+
href: string;
|
|
6
|
+
userName: string;
|
|
7
|
+
taxYear: string;
|
|
8
|
+
}) => ActionEmailData;
|
|
9
|
+
export declare const Tax1099EmailTemplate: ({ type, taxYear, ...props }: Omit<ActionEmailTemplateProps, 'listing' | 'month'> & {
|
|
10
|
+
type: Tax1099EmailType;
|
|
11
|
+
taxYear: string;
|
|
12
|
+
}) => import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Tax1099EmailTemplate = exports.getDefaultTax1099EmailData = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const extensions_1 = require("../extensions");
|
|
6
|
+
const components_1 = require("../components");
|
|
7
|
+
// PRO-20621: the 1099 owner emails teams edit in Settings > Emails. The date
|
|
8
|
+
// token renders the tax year. Subject and preview text are plain text without
|
|
9
|
+
// tokens, so they name no year.
|
|
10
|
+
const getDefaultTax1099EmailData = (type, mode, args) => {
|
|
11
|
+
const href = mode === 'tag' ? extensions_1.EMAIL_ACTION_LINK_COMPONENT : args.href;
|
|
12
|
+
const userName = mode === 'tag' ? extensions_1.EMAIL_USER_NAME_COMPONENT : args.userName;
|
|
13
|
+
const taxYear = mode === 'tag' ? extensions_1.EMAIL_DATE_COMPONENT : args.taxYear;
|
|
14
|
+
const team = args.teamName;
|
|
15
|
+
const linkLine = `<p style="color:#737373;font-size:13px">If the button doesn't work, copy this link into your browser: ${href}</p>`;
|
|
16
|
+
if (type === 'taxInfoRequest')
|
|
17
|
+
return {
|
|
18
|
+
subject: `${team} needs your tax info`,
|
|
19
|
+
shortDescription: `Add your tax ID in your owner portal so ${team} can send your 1099.`,
|
|
20
|
+
header: 'Complete your tax info',
|
|
21
|
+
bodyOne: `<p>Hi ${userName},</p><p>${team} needs your tax ID to send your ${taxYear} 1099. Add it on Tax info in your owner portal.</p>`,
|
|
22
|
+
buttonText: 'Complete tax info',
|
|
23
|
+
bodyTwo: `<p>Never send your tax ID by email. If you did not expect this request, contact ${team} before you enter it.</p>${linkLine}`,
|
|
24
|
+
href: args.href,
|
|
25
|
+
};
|
|
26
|
+
if (type === 'emailDeliveryRequest')
|
|
27
|
+
return {
|
|
28
|
+
subject: `Get your 1099s from ${team} by email`,
|
|
29
|
+
shortDescription: 'Confirm in your owner portal that you want your 1099s by email only.',
|
|
30
|
+
header: 'Get your 1099s by email',
|
|
31
|
+
bodyOne: `<p>Hi ${userName},</p><p>${team} asks whether you want your 1099s by email only, without a paper copy by mail. You then get an email when your 1099 is ready, and it stays in Tax Statements in your owner portal.</p><p>Nothing changes until you confirm on Tax info.</p>`,
|
|
32
|
+
buttonText: 'Choose 1099 delivery',
|
|
33
|
+
bodyTwo: linkLine,
|
|
34
|
+
href: args.href,
|
|
35
|
+
};
|
|
36
|
+
if (type === 'tax1099Ready')
|
|
37
|
+
return {
|
|
38
|
+
subject: `Your 1099 from ${team} is ready`,
|
|
39
|
+
shortDescription: 'Open it in Tax Statements in your owner portal.',
|
|
40
|
+
header: 'Your 1099 is ready',
|
|
41
|
+
bodyOne: `<p>Hi ${userName},</p><p>Your ${taxYear} 1099 from ${team} is in Tax Statements in your owner portal. You can download and print it there.</p>`,
|
|
42
|
+
buttonText: 'Open Tax Statements',
|
|
43
|
+
bodyTwo: `<p>If you get your 1099 by mail too, the paper copy is on its way.</p>${linkLine}`,
|
|
44
|
+
href: args.href,
|
|
45
|
+
};
|
|
46
|
+
return {
|
|
47
|
+
subject: `Your corrected 1099 from ${team}`,
|
|
48
|
+
shortDescription: 'Open it in Tax Statements in your owner portal.',
|
|
49
|
+
header: 'Your 1099 was corrected',
|
|
50
|
+
bodyOne: `<p>Hi ${userName},</p><p>${team} filed a corrected ${taxYear} 1099 for you. It replaces the earlier one and is in Tax Statements in your owner portal.</p>`,
|
|
51
|
+
buttonText: 'Open Tax Statements',
|
|
52
|
+
bodyTwo: `<p>If you get your 1099 by mail too, the corrected paper copy is on its way.</p>${linkLine}`,
|
|
53
|
+
href: args.href,
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
exports.getDefaultTax1099EmailData = getDefaultTax1099EmailData;
|
|
57
|
+
const Tax1099EmailTemplate = ({ type, taxYear, ...props }) => ((0, jsx_runtime_1.jsx)(components_1.ActionEmailTemplate, { ...props, listing: undefined, month: taxYear, eyebrow: type === 'taxInfoRequest' || type === 'emailDeliveryRequest'
|
|
58
|
+
? 'Tax info'
|
|
59
|
+
: 'Tax statements' }));
|
|
60
|
+
exports.Tax1099EmailTemplate = Tax1099EmailTemplate;
|
|
61
|
+
//# sourceMappingURL=Tax1099EmailTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tax1099EmailTemplate.js","sourceRoot":"src/","sources":["templates/Tax1099EmailTemplate.tsx"],"names":[],"mappings":";;;;AAAA,8CAIuB;AACvB,8CAIuB;AAQvB,6EAA6E;AAC7E,8EAA8E;AAC9E,gCAAgC;AACzB,MAAM,0BAA0B,GAAG,CACxC,IAAsB,EACtB,IAAoB,EACpB,IAKC,EACgB,EAAE;IACnB,MAAM,IAAI,GAAG,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,wCAA2B,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACtE,MAAM,QAAQ,GAAG,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,sCAAyB,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC5E,MAAM,OAAO,GAAG,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,iCAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACrE,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC3B,MAAM,QAAQ,GAAG,yGAAyG,IAAI,MAAM,CAAC;IAErI,IAAI,IAAI,KAAK,gBAAgB;QAC3B,OAAO;YACL,OAAO,EAAE,GAAG,IAAI,sBAAsB;YACtC,gBAAgB,EAAE,2CAA2C,IAAI,sBAAsB;YACvF,MAAM,EAAE,wBAAwB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,EAIT,EAAE,EAAE,CAAC,CACJ,uBAAC,gCAAmB,OACd,KAAK,EACT,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,OAAO,EACd,OAAO,EACL,IAAI,KAAK,gBAAgB,IAAI,IAAI,KAAK,sBAAsB;QAC1D,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,gBAAgB,GAEtB,CACH,CAAC;AAlBW,QAAA,oBAAoB,GAApB,oBAAoB,CAkB/B","sourcesContent":["import {\n EMAIL_ACTION_LINK_COMPONENT,\n EMAIL_DATE_COMPONENT,\n EMAIL_USER_NAME_COMPONENT,\n} from '../extensions';\nimport {\n type ActionEmailData,\n ActionEmailTemplate,\n type ActionEmailTemplateProps,\n} from '../components';\n\ntype Tax1099EmailType =\n | 'taxInfoRequest'\n | 'emailDeliveryRequest'\n | 'tax1099Ready'\n | 'tax1099Corrected';\n\n// PRO-20621: the 1099 owner emails teams edit in Settings > Emails. The date\n// token renders the tax year. Subject and preview text are plain text without\n// tokens, so they name no year.\nexport const getDefaultTax1099EmailData = (\n type: Tax1099EmailType,\n mode: 'tag' | 'text',\n args: {\n teamName: string;\n href: string;\n userName: string;\n taxYear: string;\n }\n): ActionEmailData => {\n const href = mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.href;\n const userName = mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.userName;\n const taxYear = mode === 'tag' ? EMAIL_DATE_COMPONENT : args.taxYear;\n const team = args.teamName;\n const linkLine = `<p style=\"color:#737373;font-size:13px\">If the button doesn't work, copy this link into your browser: ${href}</p>`;\n\n if (type === 'taxInfoRequest')\n return {\n subject: `${team} needs your tax info`,\n shortDescription: `Add your tax ID in your owner portal so ${team} can send your 1099.`,\n header: 'Complete your tax info',\n bodyOne: `<p>Hi ${userName},</p><p>${team} needs your tax ID to send your ${taxYear} 1099. Add it on Tax info in your owner portal.</p>`,\n buttonText: 'Complete tax info',\n bodyTwo: `<p>Never send your tax ID by email. If you did not expect this request, contact ${team} before you enter it.</p>${linkLine}`,\n href: args.href,\n };\n\n if (type === 'emailDeliveryRequest')\n return {\n subject: `Get your 1099s from ${team} by email`,\n shortDescription:\n 'Confirm in your owner portal that you want your 1099s by email only.',\n header: 'Get your 1099s by email',\n bodyOne: `<p>Hi ${userName},</p><p>${team} asks whether you want your 1099s by email only, without a paper copy by mail. You then get an email when your 1099 is ready, and it stays in Tax Statements in your owner portal.</p><p>Nothing changes until you confirm on Tax info.</p>`,\n buttonText: 'Choose 1099 delivery',\n bodyTwo: linkLine,\n href: args.href,\n };\n\n if (type === 'tax1099Ready')\n return {\n subject: `Your 1099 from ${team} is ready`,\n shortDescription: 'Open it in Tax Statements in your owner portal.',\n header: 'Your 1099 is ready',\n bodyOne: `<p>Hi ${userName},</p><p>Your ${taxYear} 1099 from ${team} is in Tax Statements in your owner portal. You can download and print it there.</p>`,\n buttonText: 'Open Tax Statements',\n bodyTwo: `<p>If you get your 1099 by mail too, the paper copy is on its way.</p>${linkLine}`,\n href: args.href,\n };\n\n return {\n subject: `Your corrected 1099 from ${team}`,\n shortDescription: 'Open it in Tax Statements in your owner portal.',\n header: 'Your 1099 was corrected',\n bodyOne: `<p>Hi ${userName},</p><p>${team} filed a corrected ${taxYear} 1099 for you. It replaces the earlier one and is in Tax Statements in your owner portal.</p>`,\n buttonText: 'Open Tax Statements',\n bodyTwo: `<p>If you get your 1099 by mail too, the corrected paper copy is on its way.</p>${linkLine}`,\n href: args.href,\n };\n};\n\nexport const Tax1099EmailTemplate = ({\n type,\n taxYear,\n ...props\n}: Omit<ActionEmailTemplateProps, 'listing' | 'month'> & {\n type: Tax1099EmailType;\n taxYear: string;\n}) => (\n <ActionEmailTemplate\n {...props}\n listing={undefined}\n month={taxYear}\n eyebrow={\n type === 'taxInfoRequest' || type === 'emailDeliveryRequest'\n ? 'Tax info'\n : 'Tax statements'\n }\n />\n);\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EmailBaseProps } from '../types';
|
|
2
|
+
export type TeamApiTokenCreatedEmailTemplateProps = {
|
|
3
|
+
mode: EmailBaseProps['mode'];
|
|
4
|
+
tenant: EmailBaseProps['tenant'];
|
|
5
|
+
hint: string;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
createdBy: string | null;
|
|
8
|
+
href: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const TeamApiTokenCreatedEmailTemplate: ({ mode, tenant, hint, createdAt, createdBy, href, }: TeamApiTokenCreatedEmailTemplateProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TeamApiTokenCreatedEmailTemplate = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const heading_1 = require("@react-email/heading");
|
|
6
|
+
const text_1 = require("@react-email/text");
|
|
7
|
+
const Button_1 = require("../components/Button");
|
|
8
|
+
const EmailContainer_1 = require("../components/EmailContainer");
|
|
9
|
+
const theme_1 = require("../theme");
|
|
10
|
+
const TeamApiTokenCreatedEmailTemplate = ({ mode, tenant, hint, createdAt, createdBy, href, }) => ((0, jsx_runtime_1.jsxs)(EmailContainer_1.EmailContainer, { title: `New API key on ${tenant.name}`, shortDescription: `An API key ending in ${hint} was created on ${tenant.name}.`, tenant: tenant, mode: mode, children: [(0, jsx_runtime_1.jsx)(heading_1.Heading, { style: { fontSize: 28, fontWeight: 600, marginBottom: '50px' }, children: "New API key on your team" }), (0, jsx_runtime_1.jsxs)(text_1.Text, { children: ["An API key ending in ", (0, jsx_runtime_1.jsx)("b", { children: hint }), " was created on ", tenant.name, " on", ' ', createdAt, createdBy ? ` by ${createdBy}` : '', ". Anyone holding it can read and change your team's data."] }), (0, jsx_runtime_1.jsx)(text_1.Text, { children: "If you did not expect this key, revoke it and review the team members." }), (0, jsx_runtime_1.jsx)(Button_1.Button, { href: href, mode: mode, label: "Review API keys", themeColors: theme_1.THEME_COLORS.vrplatform })] }));
|
|
11
|
+
exports.TeamApiTokenCreatedEmailTemplate = TeamApiTokenCreatedEmailTemplate;
|
|
12
|
+
//# sourceMappingURL=TeamApiTokenCreatedEmailTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TeamApiTokenCreatedEmailTemplate.js","sourceRoot":"src/","sources":["templates/TeamApiTokenCreatedEmailTemplate.tsx"],"names":[],"mappings":";;;;AAAA,kDAA+C;AAC/C,4CAAyC;AACzC,iDAA8C;AAC9C,iEAA8D;AAC9D,oCAAwC;AAYjC,MAAM,gCAAgC,GAAG,CAAC,EAC/C,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,SAAS,EACT,SAAS,EACT,IAAI,GACkC,EAAE,EAAE,CAAC,CAC3C,wBAAC,+BAAc,IACb,KAAK,EAAE,kBAAkB,MAAM,CAAC,IAAI,EAAE,EACtC,gBAAgB,EAAE,wBAAwB,IAAI,mBAAmB,MAAM,CAAC,IAAI,GAAG,EAC/E,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,aAEV,uBAAC,iBAAO,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,yCAE7D,EACV,wBAAC,WAAI,wCACkB,wCAAI,IAAI,GAAK,sBAAiB,MAAM,CAAC,IAAI,SAAK,GAAG,EACrE,SAAS,EACT,SAAS,CAAC,CAAC,CAAC,OAAO,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,iEAE/B,EACP,uBAAC,WAAI,yFAEE,EACP,uBAAC,eAAM,IACL,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAC,iBAAiB,EACvB,WAAW,EAAE,oBAAY,CAAC,UAAW,GACrC,IACa,CAClB,CAAC;AAjCW,QAAA,gCAAgC,GAAhC,gCAAgC,CAiC3C","sourcesContent":["import { Heading } from '@react-email/heading';\nimport { Text } from '@react-email/text';\nimport { Button } from '../components/Button';\nimport { EmailContainer } from '../components/EmailContainer';\nimport { THEME_COLORS } from '../theme';\nimport type { EmailBaseProps } from '../types';\n\nexport type TeamApiTokenCreatedEmailTemplateProps = {\n mode: EmailBaseProps['mode'];\n tenant: EmailBaseProps['tenant'];\n hint: string;\n createdAt: string;\n createdBy: string | null;\n href: string;\n};\n\nexport const TeamApiTokenCreatedEmailTemplate = ({\n mode,\n tenant,\n hint,\n createdAt,\n createdBy,\n href,\n}: TeamApiTokenCreatedEmailTemplateProps) => (\n <EmailContainer\n title={`New API key on ${tenant.name}`}\n shortDescription={`An API key ending in ${hint} was created on ${tenant.name}.`}\n tenant={tenant}\n mode={mode}\n >\n <Heading style={{ fontSize: 28, fontWeight: 600, marginBottom: '50px' }}>\n New API key on your team\n </Heading>\n <Text>\n An API key ending in <b>{hint}</b> was created on {tenant.name} on{' '}\n {createdAt}\n {createdBy ? ` by ${createdBy}` : ''}. Anyone holding it can read and\n change your team's data.\n </Text>\n <Text>\n If you did not expect this key, revoke it and review the team members.\n </Text>\n <Button\n href={href}\n mode={mode}\n label=\"Review API keys\"\n themeColors={THEME_COLORS.vrplatform!}\n />\n </EmailContainer>\n);\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './TeamApiTokenCreatedEmailTemplate';
|
|
1
2
|
export * from './TeamRoleGrantedEmailTemplate';
|
|
2
3
|
export * from './TenantSuspensionEmailTemplate';
|
|
3
4
|
export * from './TenantDeletionEmailTemplate';
|
|
@@ -5,5 +6,6 @@ export * from './OwnerStatementEmailTemplate';
|
|
|
5
6
|
export * from './BankAccountChangedEmailTemplate';
|
|
6
7
|
export * from './BankAccountChangedTeamAdminEmailTemplate';
|
|
7
8
|
export * from './BankDetailsRequestEmailTemplate';
|
|
9
|
+
export * from './Tax1099EmailTemplate';
|
|
8
10
|
export * from './InviteOwnerEmailTemplate';
|
|
9
11
|
export * from './InvitePmEmailTemplate';
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
// Teams
|
|
18
|
+
__exportStar(require("./TeamApiTokenCreatedEmailTemplate"), exports);
|
|
18
19
|
__exportStar(require("./TeamRoleGrantedEmailTemplate"), exports);
|
|
19
20
|
__exportStar(require("./TenantSuspensionEmailTemplate"), exports);
|
|
20
21
|
__exportStar(require("./TenantDeletionEmailTemplate"), exports);
|
|
@@ -24,6 +25,8 @@ __exportStar(require("./OwnerStatementEmailTemplate"), exports);
|
|
|
24
25
|
__exportStar(require("./BankAccountChangedEmailTemplate"), exports);
|
|
25
26
|
__exportStar(require("./BankAccountChangedTeamAdminEmailTemplate"), exports);
|
|
26
27
|
__exportStar(require("./BankDetailsRequestEmailTemplate"), exports);
|
|
28
|
+
// 1099s
|
|
29
|
+
__exportStar(require("./Tax1099EmailTemplate"), exports);
|
|
27
30
|
// Invitations
|
|
28
31
|
__exportStar(require("./InviteOwnerEmailTemplate"), exports);
|
|
29
32
|
__exportStar(require("./InvitePmEmailTemplate"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["templates/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,iEAA+C;AAC/C,kEAAgD;AAChD,gEAA8C;AAE9C,mBAAmB;AACnB,gEAA8C;AAE9C,gBAAgB;AAChB,oEAAkD;AAClD,6EAA2D;AAC3D,oEAAkD;AAElD,cAAc;AACd,6DAA2C;AAC3C,0DAAwC","sourcesContent":["// Teams\nexport * from './TeamRoleGrantedEmailTemplate';\nexport * from './TenantSuspensionEmailTemplate';\nexport * from './TenantDeletionEmailTemplate';\n\n// Owner Statements\nexport * from './OwnerStatementEmailTemplate';\n\n// Payment setup\nexport * from './BankAccountChangedEmailTemplate';\nexport * from './BankAccountChangedTeamAdminEmailTemplate';\nexport * from './BankDetailsRequestEmailTemplate';\n\n// Invitations\nexport * from './InviteOwnerEmailTemplate';\nexport * from './InvitePmEmailTemplate';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["templates/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,qEAAmD;AACnD,iEAA+C;AAC/C,kEAAgD;AAChD,gEAA8C;AAE9C,mBAAmB;AACnB,gEAA8C;AAE9C,gBAAgB;AAChB,oEAAkD;AAClD,6EAA2D;AAC3D,oEAAkD;AAElD,QAAQ;AACR,yDAAuC;AAEvC,cAAc;AACd,6DAA2C;AAC3C,0DAAwC","sourcesContent":["// Teams\nexport * from './TeamApiTokenCreatedEmailTemplate';\nexport * from './TeamRoleGrantedEmailTemplate';\nexport * from './TenantSuspensionEmailTemplate';\nexport * from './TenantDeletionEmailTemplate';\n\n// Owner Statements\nexport * from './OwnerStatementEmailTemplate';\n\n// Payment setup\nexport * from './BankAccountChangedEmailTemplate';\nexport * from './BankAccountChangedTeamAdminEmailTemplate';\nexport * from './BankDetailsRequestEmailTemplate';\n\n// 1099s\nexport * from './Tax1099EmailTemplate';\n\n// Invitations\nexport * from './InviteOwnerEmailTemplate';\nexport * from './InvitePmEmailTemplate';\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ActionEmailData, type ActionEmailTemplateProps } from '../components';
|
|
2
|
+
type Tax1099EmailType = 'taxInfoRequest' | 'emailDeliveryRequest' | 'tax1099Ready' | 'tax1099Corrected';
|
|
3
|
+
export declare const getDefaultTax1099EmailData: (type: Tax1099EmailType, mode: 'tag' | 'text', args: {
|
|
4
|
+
teamName: string;
|
|
5
|
+
href: string;
|
|
6
|
+
userName: string;
|
|
7
|
+
taxYear: string;
|
|
8
|
+
}) => ActionEmailData;
|
|
9
|
+
export declare const Tax1099EmailTemplate: ({ type, taxYear, ...props }: Omit<ActionEmailTemplateProps, 'listing' | 'month'> & {
|
|
10
|
+
type: Tax1099EmailType;
|
|
11
|
+
taxYear: string;
|
|
12
|
+
}) => import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { EMAIL_ACTION_LINK_COMPONENT, EMAIL_DATE_COMPONENT, EMAIL_USER_NAME_COMPONENT, } from '../extensions';
|
|
3
|
+
import { ActionEmailTemplate, } from '../components';
|
|
4
|
+
// PRO-20621: the 1099 owner emails teams edit in Settings > Emails. The date
|
|
5
|
+
// token renders the tax year. Subject and preview text are plain text without
|
|
6
|
+
// tokens, so they name no year.
|
|
7
|
+
export const getDefaultTax1099EmailData = (type, mode, args) => {
|
|
8
|
+
const href = mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.href;
|
|
9
|
+
const userName = mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.userName;
|
|
10
|
+
const taxYear = mode === 'tag' ? EMAIL_DATE_COMPONENT : args.taxYear;
|
|
11
|
+
const team = args.teamName;
|
|
12
|
+
const linkLine = `<p style="color:#737373;font-size:13px">If the button doesn't work, copy this link into your browser: ${href}</p>`;
|
|
13
|
+
if (type === 'taxInfoRequest')
|
|
14
|
+
return {
|
|
15
|
+
subject: `${team} needs your tax info`,
|
|
16
|
+
shortDescription: `Add your tax ID in your owner portal so ${team} can send your 1099.`,
|
|
17
|
+
header: 'Complete your tax info',
|
|
18
|
+
bodyOne: `<p>Hi ${userName},</p><p>${team} needs your tax ID to send your ${taxYear} 1099. Add it on Tax info in your owner portal.</p>`,
|
|
19
|
+
buttonText: 'Complete tax info',
|
|
20
|
+
bodyTwo: `<p>Never send your tax ID by email. If you did not expect this request, contact ${team} before you enter it.</p>${linkLine}`,
|
|
21
|
+
href: args.href,
|
|
22
|
+
};
|
|
23
|
+
if (type === 'emailDeliveryRequest')
|
|
24
|
+
return {
|
|
25
|
+
subject: `Get your 1099s from ${team} by email`,
|
|
26
|
+
shortDescription: 'Confirm in your owner portal that you want your 1099s by email only.',
|
|
27
|
+
header: 'Get your 1099s by email',
|
|
28
|
+
bodyOne: `<p>Hi ${userName},</p><p>${team} asks whether you want your 1099s by email only, without a paper copy by mail. You then get an email when your 1099 is ready, and it stays in Tax Statements in your owner portal.</p><p>Nothing changes until you confirm on Tax info.</p>`,
|
|
29
|
+
buttonText: 'Choose 1099 delivery',
|
|
30
|
+
bodyTwo: linkLine,
|
|
31
|
+
href: args.href,
|
|
32
|
+
};
|
|
33
|
+
if (type === 'tax1099Ready')
|
|
34
|
+
return {
|
|
35
|
+
subject: `Your 1099 from ${team} is ready`,
|
|
36
|
+
shortDescription: 'Open it in Tax Statements in your owner portal.',
|
|
37
|
+
header: 'Your 1099 is ready',
|
|
38
|
+
bodyOne: `<p>Hi ${userName},</p><p>Your ${taxYear} 1099 from ${team} is in Tax Statements in your owner portal. You can download and print it there.</p>`,
|
|
39
|
+
buttonText: 'Open Tax Statements',
|
|
40
|
+
bodyTwo: `<p>If you get your 1099 by mail too, the paper copy is on its way.</p>${linkLine}`,
|
|
41
|
+
href: args.href,
|
|
42
|
+
};
|
|
43
|
+
return {
|
|
44
|
+
subject: `Your corrected 1099 from ${team}`,
|
|
45
|
+
shortDescription: 'Open it in Tax Statements in your owner portal.',
|
|
46
|
+
header: 'Your 1099 was corrected',
|
|
47
|
+
bodyOne: `<p>Hi ${userName},</p><p>${team} filed a corrected ${taxYear} 1099 for you. It replaces the earlier one and is in Tax Statements in your owner portal.</p>`,
|
|
48
|
+
buttonText: 'Open Tax Statements',
|
|
49
|
+
bodyTwo: `<p>If you get your 1099 by mail too, the corrected paper copy is on its way.</p>${linkLine}`,
|
|
50
|
+
href: args.href,
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export const Tax1099EmailTemplate = ({ type, taxYear, ...props }) => (_jsx(ActionEmailTemplate, { ...props, listing: undefined, month: taxYear, eyebrow: type === 'taxInfoRequest' || type === 'emailDeliveryRequest'
|
|
54
|
+
? 'Tax info'
|
|
55
|
+
: 'Tax statements' }));
|
|
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["import {\n EMAIL_ACTION_LINK_COMPONENT,\n EMAIL_DATE_COMPONENT,\n EMAIL_USER_NAME_COMPONENT,\n} from '../extensions';\nimport {\n type ActionEmailData,\n ActionEmailTemplate,\n type ActionEmailTemplateProps,\n} from '../components';\n\ntype Tax1099EmailType =\n | 'taxInfoRequest'\n | 'emailDeliveryRequest'\n | 'tax1099Ready'\n | 'tax1099Corrected';\n\n// PRO-20621: the 1099 owner emails teams edit in Settings > Emails. The date\n// token renders the tax year. Subject and preview text are plain text without\n// tokens, so they name no year.\nexport const getDefaultTax1099EmailData = (\n type: Tax1099EmailType,\n mode: 'tag' | 'text',\n args: {\n teamName: string;\n href: string;\n userName: string;\n taxYear: string;\n }\n): ActionEmailData => {\n const href = mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.href;\n const userName = mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.userName;\n const taxYear = mode === 'tag' ? EMAIL_DATE_COMPONENT : args.taxYear;\n const team = args.teamName;\n const linkLine = `<p style=\"color:#737373;font-size:13px\">If the button doesn't work, copy this link into your browser: ${href}</p>`;\n\n if (type === 'taxInfoRequest')\n return {\n subject: `${team} needs your tax info`,\n shortDescription: `Add your tax ID in your owner portal so ${team} can send your 1099.`,\n header: 'Complete your tax info',\n bodyOne: `<p>Hi ${userName},</p><p>${team} needs your tax ID to send your ${taxYear} 1099. Add it on Tax info in your owner portal.</p>`,\n buttonText: 'Complete tax info',\n bodyTwo: `<p>Never send your tax ID by email. If you did not expect this request, contact ${team} before you enter it.</p>${linkLine}`,\n href: args.href,\n };\n\n if (type === 'emailDeliveryRequest')\n return {\n subject: `Get your 1099s from ${team} by email`,\n shortDescription:\n 'Confirm in your owner portal that you want your 1099s by email only.',\n header: 'Get your 1099s by email',\n bodyOne: `<p>Hi ${userName},</p><p>${team} asks whether you want your 1099s by email only, without a paper copy by mail. You then get an email when your 1099 is ready, and it stays in Tax Statements in your owner portal.</p><p>Nothing changes until you confirm on Tax info.</p>`,\n buttonText: 'Choose 1099 delivery',\n bodyTwo: linkLine,\n href: args.href,\n };\n\n if (type === 'tax1099Ready')\n return {\n subject: `Your 1099 from ${team} is ready`,\n shortDescription: 'Open it in Tax Statements in your owner portal.',\n header: 'Your 1099 is ready',\n bodyOne: `<p>Hi ${userName},</p><p>Your ${taxYear} 1099 from ${team} is in Tax Statements in your owner portal. You can download and print it there.</p>`,\n buttonText: 'Open Tax Statements',\n bodyTwo: `<p>If you get your 1099 by mail too, the paper copy is on its way.</p>${linkLine}`,\n href: args.href,\n };\n\n return {\n subject: `Your corrected 1099 from ${team}`,\n shortDescription: 'Open it in Tax Statements in your owner portal.',\n header: 'Your 1099 was corrected',\n bodyOne: `<p>Hi ${userName},</p><p>${team} filed a corrected ${taxYear} 1099 for you. It replaces the earlier one and is in Tax Statements in your owner portal.</p>`,\n buttonText: 'Open Tax Statements',\n bodyTwo: `<p>If you get your 1099 by mail too, the corrected paper copy is on its way.</p>${linkLine}`,\n href: args.href,\n };\n};\n\nexport const Tax1099EmailTemplate = ({\n type,\n taxYear,\n ...props\n}: Omit<ActionEmailTemplateProps, 'listing' | 'month'> & {\n type: Tax1099EmailType;\n taxYear: string;\n}) => (\n <ActionEmailTemplate\n {...props}\n listing={undefined}\n month={taxYear}\n eyebrow={\n type === 'taxInfoRequest' || type === 'emailDeliveryRequest'\n ? 'Tax info'\n : 'Tax statements'\n }\n />\n);\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EmailBaseProps } from '../types';
|
|
2
|
+
export type TeamApiTokenCreatedEmailTemplateProps = {
|
|
3
|
+
mode: EmailBaseProps['mode'];
|
|
4
|
+
tenant: EmailBaseProps['tenant'];
|
|
5
|
+
hint: string;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
createdBy: string | null;
|
|
8
|
+
href: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const TeamApiTokenCreatedEmailTemplate: ({ mode, tenant, hint, createdAt, createdBy, href, }: TeamApiTokenCreatedEmailTemplateProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Heading } from '@react-email/heading';
|
|
3
|
+
import { Text } from '@react-email/text';
|
|
4
|
+
import { Button } from '../components/Button';
|
|
5
|
+
import { EmailContainer } from '../components/EmailContainer';
|
|
6
|
+
import { THEME_COLORS } from '../theme';
|
|
7
|
+
export const TeamApiTokenCreatedEmailTemplate = ({ mode, tenant, hint, createdAt, createdBy, href, }) => (_jsxs(EmailContainer, { title: `New API key on ${tenant.name}`, shortDescription: `An API key ending in ${hint} was created on ${tenant.name}.`, tenant: tenant, mode: mode, children: [_jsx(Heading, { style: { fontSize: 28, fontWeight: 600, marginBottom: '50px' }, children: "New API key on your team" }), _jsxs(Text, { children: ["An API key ending in ", _jsx("b", { children: hint }), " was created on ", tenant.name, " on", ' ', createdAt, createdBy ? ` by ${createdBy}` : '', ". Anyone holding it can read and change your team's data."] }), _jsx(Text, { children: "If you did not expect this key, revoke it and review the team members." }), _jsx(Button, { href: href, mode: mode, label: "Review API keys", themeColors: THEME_COLORS.vrplatform })] }));
|
|
8
|
+
//# sourceMappingURL=TeamApiTokenCreatedEmailTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TeamApiTokenCreatedEmailTemplate.js","sourceRoot":"src/","sources":["templates/TeamApiTokenCreatedEmailTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAYxC,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,EAC/C,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,SAAS,EACT,SAAS,EACT,IAAI,GACkC,EAAE,EAAE,CAAC,CAC3C,MAAC,cAAc,IACb,KAAK,EAAE,kBAAkB,MAAM,CAAC,IAAI,EAAE,EACtC,gBAAgB,EAAE,wBAAwB,IAAI,mBAAmB,MAAM,CAAC,IAAI,GAAG,EAC/E,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,aAEV,KAAC,OAAO,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,yCAE7D,EACV,MAAC,IAAI,wCACkB,sBAAI,IAAI,GAAK,sBAAiB,MAAM,CAAC,IAAI,SAAK,GAAG,EACrE,SAAS,EACT,SAAS,CAAC,CAAC,CAAC,OAAO,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,iEAE/B,EACP,KAAC,IAAI,yFAEE,EACP,KAAC,MAAM,IACL,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAC,iBAAiB,EACvB,WAAW,EAAE,YAAY,CAAC,UAAW,GACrC,IACa,CAClB,CAAC","sourcesContent":["import { Heading } from '@react-email/heading';\nimport { Text } from '@react-email/text';\nimport { Button } from '../components/Button';\nimport { EmailContainer } from '../components/EmailContainer';\nimport { THEME_COLORS } from '../theme';\nimport type { EmailBaseProps } from '../types';\n\nexport type TeamApiTokenCreatedEmailTemplateProps = {\n mode: EmailBaseProps['mode'];\n tenant: EmailBaseProps['tenant'];\n hint: string;\n createdAt: string;\n createdBy: string | null;\n href: string;\n};\n\nexport const TeamApiTokenCreatedEmailTemplate = ({\n mode,\n tenant,\n hint,\n createdAt,\n createdBy,\n href,\n}: TeamApiTokenCreatedEmailTemplateProps) => (\n <EmailContainer\n title={`New API key on ${tenant.name}`}\n shortDescription={`An API key ending in ${hint} was created on ${tenant.name}.`}\n tenant={tenant}\n mode={mode}\n >\n <Heading style={{ fontSize: 28, fontWeight: 600, marginBottom: '50px' }}>\n New API key on your team\n </Heading>\n <Text>\n An API key ending in <b>{hint}</b> was created on {tenant.name} on{' '}\n {createdAt}\n {createdBy ? ` by ${createdBy}` : ''}. Anyone holding it can read and\n change your team's data.\n </Text>\n <Text>\n If you did not expect this key, revoke it and review the team members.\n </Text>\n <Button\n href={href}\n mode={mode}\n label=\"Review API keys\"\n themeColors={THEME_COLORS.vrplatform!}\n />\n </EmailContainer>\n);\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './TeamApiTokenCreatedEmailTemplate';
|
|
1
2
|
export * from './TeamRoleGrantedEmailTemplate';
|
|
2
3
|
export * from './TenantSuspensionEmailTemplate';
|
|
3
4
|
export * from './TenantDeletionEmailTemplate';
|
|
@@ -5,5 +6,6 @@ export * from './OwnerStatementEmailTemplate';
|
|
|
5
6
|
export * from './BankAccountChangedEmailTemplate';
|
|
6
7
|
export * from './BankAccountChangedTeamAdminEmailTemplate';
|
|
7
8
|
export * from './BankDetailsRequestEmailTemplate';
|
|
9
|
+
export * from './Tax1099EmailTemplate';
|
|
8
10
|
export * from './InviteOwnerEmailTemplate';
|
|
9
11
|
export * from './InvitePmEmailTemplate';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Teams
|
|
2
|
+
export * from './TeamApiTokenCreatedEmailTemplate';
|
|
2
3
|
export * from './TeamRoleGrantedEmailTemplate';
|
|
3
4
|
export * from './TenantSuspensionEmailTemplate';
|
|
4
5
|
export * from './TenantDeletionEmailTemplate';
|
|
@@ -8,6 +9,8 @@ export * from './OwnerStatementEmailTemplate';
|
|
|
8
9
|
export * from './BankAccountChangedEmailTemplate';
|
|
9
10
|
export * from './BankAccountChangedTeamAdminEmailTemplate';
|
|
10
11
|
export * from './BankDetailsRequestEmailTemplate';
|
|
12
|
+
// 1099s
|
|
13
|
+
export * from './Tax1099EmailTemplate';
|
|
11
14
|
// Invitations
|
|
12
15
|
export * from './InviteOwnerEmailTemplate';
|
|
13
16
|
export * from './InvitePmEmailTemplate';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["templates/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAE9C,mBAAmB;AACnB,cAAc,+BAA+B,CAAC;AAE9C,gBAAgB;AAChB,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mCAAmC,CAAC;AAElD,cAAc;AACd,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC","sourcesContent":["// Teams\nexport * from './TeamRoleGrantedEmailTemplate';\nexport * from './TenantSuspensionEmailTemplate';\nexport * from './TenantDeletionEmailTemplate';\n\n// Owner Statements\nexport * from './OwnerStatementEmailTemplate';\n\n// Payment setup\nexport * from './BankAccountChangedEmailTemplate';\nexport * from './BankAccountChangedTeamAdminEmailTemplate';\nexport * from './BankDetailsRequestEmailTemplate';\n\n// Invitations\nexport * from './InviteOwnerEmailTemplate';\nexport * from './InvitePmEmailTemplate';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["templates/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAE9C,mBAAmB;AACnB,cAAc,+BAA+B,CAAC;AAE9C,gBAAgB;AAChB,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mCAAmC,CAAC;AAElD,QAAQ;AACR,cAAc,wBAAwB,CAAC;AAEvC,cAAc;AACd,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC","sourcesContent":["// Teams\nexport * from './TeamApiTokenCreatedEmailTemplate';\nexport * from './TeamRoleGrantedEmailTemplate';\nexport * from './TenantSuspensionEmailTemplate';\nexport * from './TenantDeletionEmailTemplate';\n\n// Owner Statements\nexport * from './OwnerStatementEmailTemplate';\n\n// Payment setup\nexport * from './BankAccountChangedEmailTemplate';\nexport * from './BankAccountChangedTeamAdminEmailTemplate';\nexport * from './BankDetailsRequestEmailTemplate';\n\n// 1099s\nexport * from './Tax1099EmailTemplate';\n\n// Invitations\nexport * from './InviteOwnerEmailTemplate';\nexport * from './InvitePmEmailTemplate';\n"]}
|
package/package.json
CHANGED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EMAIL_ACTION_LINK_COMPONENT,
|
|
3
|
+
EMAIL_DATE_COMPONENT,
|
|
4
|
+
EMAIL_USER_NAME_COMPONENT,
|
|
5
|
+
} from '../extensions';
|
|
6
|
+
import {
|
|
7
|
+
type ActionEmailData,
|
|
8
|
+
ActionEmailTemplate,
|
|
9
|
+
type ActionEmailTemplateProps,
|
|
10
|
+
} from '../components';
|
|
11
|
+
|
|
12
|
+
type Tax1099EmailType =
|
|
13
|
+
| 'taxInfoRequest'
|
|
14
|
+
| 'emailDeliveryRequest'
|
|
15
|
+
| 'tax1099Ready'
|
|
16
|
+
| 'tax1099Corrected';
|
|
17
|
+
|
|
18
|
+
// PRO-20621: the 1099 owner emails teams edit in Settings > Emails. The date
|
|
19
|
+
// token renders the tax year. Subject and preview text are plain text without
|
|
20
|
+
// tokens, so they name no year.
|
|
21
|
+
export const getDefaultTax1099EmailData = (
|
|
22
|
+
type: Tax1099EmailType,
|
|
23
|
+
mode: 'tag' | 'text',
|
|
24
|
+
args: {
|
|
25
|
+
teamName: string;
|
|
26
|
+
href: string;
|
|
27
|
+
userName: string;
|
|
28
|
+
taxYear: string;
|
|
29
|
+
}
|
|
30
|
+
): ActionEmailData => {
|
|
31
|
+
const href = mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.href;
|
|
32
|
+
const userName = mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.userName;
|
|
33
|
+
const taxYear = mode === 'tag' ? EMAIL_DATE_COMPONENT : args.taxYear;
|
|
34
|
+
const team = args.teamName;
|
|
35
|
+
const linkLine = `<p style="color:#737373;font-size:13px">If the button doesn't work, copy this link into your browser: ${href}</p>`;
|
|
36
|
+
|
|
37
|
+
if (type === 'taxInfoRequest')
|
|
38
|
+
return {
|
|
39
|
+
subject: `${team} needs your tax info`,
|
|
40
|
+
shortDescription: `Add your tax ID in your owner portal so ${team} can send your 1099.`,
|
|
41
|
+
header: 'Complete your tax info',
|
|
42
|
+
bodyOne: `<p>Hi ${userName},</p><p>${team} needs your tax ID to send your ${taxYear} 1099. Add it on Tax info in your owner portal.</p>`,
|
|
43
|
+
buttonText: 'Complete tax info',
|
|
44
|
+
bodyTwo: `<p>Never send your tax ID by email. If you did not expect this request, contact ${team} before you enter it.</p>${linkLine}`,
|
|
45
|
+
href: args.href,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
if (type === 'emailDeliveryRequest')
|
|
49
|
+
return {
|
|
50
|
+
subject: `Get your 1099s from ${team} by email`,
|
|
51
|
+
shortDescription:
|
|
52
|
+
'Confirm in your owner portal that you want your 1099s by email only.',
|
|
53
|
+
header: 'Get your 1099s by email',
|
|
54
|
+
bodyOne: `<p>Hi ${userName},</p><p>${team} asks whether you want your 1099s by email only, without a paper copy by mail. You then get an email when your 1099 is ready, and it stays in Tax Statements in your owner portal.</p><p>Nothing changes until you confirm on Tax info.</p>`,
|
|
55
|
+
buttonText: 'Choose 1099 delivery',
|
|
56
|
+
bodyTwo: linkLine,
|
|
57
|
+
href: args.href,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
if (type === 'tax1099Ready')
|
|
61
|
+
return {
|
|
62
|
+
subject: `Your 1099 from ${team} is ready`,
|
|
63
|
+
shortDescription: 'Open it in Tax Statements in your owner portal.',
|
|
64
|
+
header: 'Your 1099 is ready',
|
|
65
|
+
bodyOne: `<p>Hi ${userName},</p><p>Your ${taxYear} 1099 from ${team} is in Tax Statements in your owner portal. You can download and print it there.</p>`,
|
|
66
|
+
buttonText: 'Open Tax Statements',
|
|
67
|
+
bodyTwo: `<p>If you get your 1099 by mail too, the paper copy is on its way.</p>${linkLine}`,
|
|
68
|
+
href: args.href,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
subject: `Your corrected 1099 from ${team}`,
|
|
73
|
+
shortDescription: 'Open it in Tax Statements in your owner portal.',
|
|
74
|
+
header: 'Your 1099 was corrected',
|
|
75
|
+
bodyOne: `<p>Hi ${userName},</p><p>${team} filed a corrected ${taxYear} 1099 for you. It replaces the earlier one and is in Tax Statements in your owner portal.</p>`,
|
|
76
|
+
buttonText: 'Open Tax Statements',
|
|
77
|
+
bodyTwo: `<p>If you get your 1099 by mail too, the corrected paper copy is on its way.</p>${linkLine}`,
|
|
78
|
+
href: args.href,
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const Tax1099EmailTemplate = ({
|
|
83
|
+
type,
|
|
84
|
+
taxYear,
|
|
85
|
+
...props
|
|
86
|
+
}: Omit<ActionEmailTemplateProps, 'listing' | 'month'> & {
|
|
87
|
+
type: Tax1099EmailType;
|
|
88
|
+
taxYear: string;
|
|
89
|
+
}) => (
|
|
90
|
+
<ActionEmailTemplate
|
|
91
|
+
{...props}
|
|
92
|
+
listing={undefined}
|
|
93
|
+
month={taxYear}
|
|
94
|
+
eyebrow={
|
|
95
|
+
type === 'taxInfoRequest' || type === 'emailDeliveryRequest'
|
|
96
|
+
? 'Tax info'
|
|
97
|
+
: 'Tax statements'
|
|
98
|
+
}
|
|
99
|
+
/>
|
|
100
|
+
);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Heading } from '@react-email/heading';
|
|
2
|
+
import { Text } from '@react-email/text';
|
|
3
|
+
import { Button } from '../components/Button';
|
|
4
|
+
import { EmailContainer } from '../components/EmailContainer';
|
|
5
|
+
import { THEME_COLORS } from '../theme';
|
|
6
|
+
import type { EmailBaseProps } from '../types';
|
|
7
|
+
|
|
8
|
+
export type TeamApiTokenCreatedEmailTemplateProps = {
|
|
9
|
+
mode: EmailBaseProps['mode'];
|
|
10
|
+
tenant: EmailBaseProps['tenant'];
|
|
11
|
+
hint: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
createdBy: string | null;
|
|
14
|
+
href: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const TeamApiTokenCreatedEmailTemplate = ({
|
|
18
|
+
mode,
|
|
19
|
+
tenant,
|
|
20
|
+
hint,
|
|
21
|
+
createdAt,
|
|
22
|
+
createdBy,
|
|
23
|
+
href,
|
|
24
|
+
}: TeamApiTokenCreatedEmailTemplateProps) => (
|
|
25
|
+
<EmailContainer
|
|
26
|
+
title={`New API key on ${tenant.name}`}
|
|
27
|
+
shortDescription={`An API key ending in ${hint} was created on ${tenant.name}.`}
|
|
28
|
+
tenant={tenant}
|
|
29
|
+
mode={mode}
|
|
30
|
+
>
|
|
31
|
+
<Heading style={{ fontSize: 28, fontWeight: 600, marginBottom: '50px' }}>
|
|
32
|
+
New API key on your team
|
|
33
|
+
</Heading>
|
|
34
|
+
<Text>
|
|
35
|
+
An API key ending in <b>{hint}</b> was created on {tenant.name} on{' '}
|
|
36
|
+
{createdAt}
|
|
37
|
+
{createdBy ? ` by ${createdBy}` : ''}. Anyone holding it can read and
|
|
38
|
+
change your team's data.
|
|
39
|
+
</Text>
|
|
40
|
+
<Text>
|
|
41
|
+
If you did not expect this key, revoke it and review the team members.
|
|
42
|
+
</Text>
|
|
43
|
+
<Button
|
|
44
|
+
href={href}
|
|
45
|
+
mode={mode}
|
|
46
|
+
label="Review API keys"
|
|
47
|
+
themeColors={THEME_COLORS.vrplatform!}
|
|
48
|
+
/>
|
|
49
|
+
</EmailContainer>
|
|
50
|
+
);
|
package/src/templates/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Teams
|
|
2
|
+
export * from './TeamApiTokenCreatedEmailTemplate';
|
|
2
3
|
export * from './TeamRoleGrantedEmailTemplate';
|
|
3
4
|
export * from './TenantSuspensionEmailTemplate';
|
|
4
5
|
export * from './TenantDeletionEmailTemplate';
|
|
@@ -11,6 +12,9 @@ export * from './BankAccountChangedEmailTemplate';
|
|
|
11
12
|
export * from './BankAccountChangedTeamAdminEmailTemplate';
|
|
12
13
|
export * from './BankDetailsRequestEmailTemplate';
|
|
13
14
|
|
|
15
|
+
// 1099s
|
|
16
|
+
export * from './Tax1099EmailTemplate';
|
|
17
|
+
|
|
14
18
|
// Invitations
|
|
15
19
|
export * from './InviteOwnerEmailTemplate';
|
|
16
20
|
export * from './InvitePmEmailTemplate';
|