@vrplatform/email 1.0.2-5 → 1.0.2-556

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.
Files changed (39) hide show
  1. package/build/main/components/EmailContainer.js +1 -1
  2. package/build/main/components/EmailContainer.js.map +1 -1
  3. package/build/main/templates/InviteOwnerEmailTemplate.d.ts +3 -1
  4. package/build/main/templates/InviteOwnerEmailTemplate.js +10 -6
  5. package/build/main/templates/InviteOwnerEmailTemplate.js.map +1 -1
  6. package/build/main/templates/InvitePmEmailTemplate.js +7 -3
  7. package/build/main/templates/InvitePmEmailTemplate.js.map +1 -1
  8. package/build/main/utils/find-postmark-email.d.ts +8 -0
  9. package/build/main/utils/find-postmark-email.js +66 -0
  10. package/build/main/utils/find-postmark-email.js.map +1 -0
  11. package/build/main/utils/index.d.ts +2 -0
  12. package/build/main/utils/index.js +2 -0
  13. package/build/main/utils/index.js.map +1 -1
  14. package/build/main/utils/send-email.d.ts +20 -3
  15. package/build/main/utils/send-email.js +97 -19
  16. package/build/main/utils/send-email.js.map +1 -1
  17. package/build/module/components/EmailContainer.js +1 -1
  18. package/build/module/components/EmailContainer.js.map +1 -1
  19. package/build/module/templates/InviteOwnerEmailTemplate.d.ts +3 -1
  20. package/build/module/templates/InviteOwnerEmailTemplate.js +10 -6
  21. package/build/module/templates/InviteOwnerEmailTemplate.js.map +1 -1
  22. package/build/module/templates/InvitePmEmailTemplate.js +7 -3
  23. package/build/module/templates/InvitePmEmailTemplate.js.map +1 -1
  24. package/build/module/utils/find-postmark-email.d.ts +8 -0
  25. package/build/module/utils/find-postmark-email.js +63 -0
  26. package/build/module/utils/find-postmark-email.js.map +1 -0
  27. package/build/module/utils/index.d.ts +2 -0
  28. package/build/module/utils/index.js +2 -0
  29. package/build/module/utils/index.js.map +1 -1
  30. package/build/module/utils/send-email.d.ts +20 -3
  31. package/build/module/utils/send-email.js +97 -19
  32. package/build/module/utils/send-email.js.map +1 -1
  33. package/package.json +1 -1
  34. package/src/components/EmailContainer.tsx +1 -1
  35. package/src/templates/InviteOwnerEmailTemplate.tsx +20 -7
  36. package/src/templates/InvitePmEmailTemplate.tsx +7 -3
  37. package/src/utils/find-postmark-email.ts +93 -0
  38. package/src/utils/index.ts +2 -0
  39. package/src/utils/send-email.ts +165 -23
@@ -50,7 +50,7 @@ const Footer = () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children
50
50
  marginBottom: '50px',
51
51
  } }), (0, jsx_runtime_1.jsxs)(text_1.Text, { style: {
52
52
  color: '#737373',
53
- }, children: ["\u00A9 ", (0, utils_1.day)().year(), " VRPlatform Ventures Ltd. All rights reserved."] }), (0, jsx_runtime_1.jsx)(text_1.Text, { style: {
53
+ }, children: ["\u00A9 ", (0, utils_1.day)().year(), " VR Technologies. All rights reserved."] }), (0, jsx_runtime_1.jsx)(text_1.Text, { style: {
54
54
  color: '#737373',
55
55
  }, children: "VR Technologies, LLC, a company incorporated and registered in the United States of America with company number 20201965158" })] }));
56
56
  const VrpLogo = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "100%", height: "100%", viewBox: "0 0 28 29", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { d: "M18.2549 8.25161C18.2549 5.89704 20.1636 3.98828 22.5182 3.98828C24.8728 3.98828 26.7815 5.89704 26.7815 8.25161C26.7815 10.6062 24.8728 12.5149 22.5182 12.5149C20.1636 12.5149 18.2549 10.6062 18.2549 8.25161Z", fill: "#172554" }), (0, jsx_runtime_1.jsx)("path", { d: "M7.02441 8.46593C7.02441 6.01867 9.20858 3.99805 11.6558 3.99805C14.1031 3.99805 15.0558 5.59785 16.5612 7.52728C17.1957 8.34054 20.7921 13.3413 20.7921 13.3413C20.7921 13.3413 21.566 14.6863 21.566 15.7894C21.566 18.5287 17.1993 22.8381 17.1993 22.8381L7.66841 10.6799C7.66841 10.6799 7.02441 10.0502 7.02441 8.46593Z", fill: "#172554", fillOpacity: "0.8" }), (0, jsx_runtime_1.jsx)("path", { d: "M1.24707 8.42687C1.24707 5.97961 3.43123 3.95898 5.8785 3.95898C8.32576 3.95898 9.27845 5.55879 10.7839 7.48824C11.4184 8.30147 14.6041 12.4888 16.8247 15.5727C18.3585 17.703 18.474 17.705 18.474 20.3439C18.474 22.9827 15.1592 24.1379 14.1483 24.1914C12.0203 24.304 10.5418 22.4681 10.5418 22.4681L1.89106 10.6408C1.89106 10.6408 1.24707 10.0111 1.24707 8.42687Z", fill: "#172554" })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"EmailContainer.js","sourceRoot":"src/","sources":["components/EmailContainer.tsx"],"names":[],"mappings":";;;;AAAA,4CAAyC;AACzC,4CAAyC;AACzC,4CAAyC;AACzC,wCAAqC;AACrC,4CAAyC;AACzC,0CAAuC;AACvC,kDAA+C;AAC/C,4CAAyC;AACzC,6CAAwC;AAWjC,MAAM,cAAc,GAAG,CAAC,KAAY,EAAE,EAAE;IAC7C,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAEpD,MAAM,mBAAmB,GAAG;QAC1B,aAAa,EAAE,MAAM;QACrB,YAAY,EAAE,MAAM;QACpB,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,QAAQ;KACjB,CAAC;IAEF,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC1B,OAAO,CACL,gCAAK,KAAK,EAAE,mBAAmB,YAC7B,uBAAC,OAAO,OAAK,KAAK,YAAG,QAAQ,GAAW,GACpC,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,wBAAC,WAAI,IAAC,IAAI,EAAC,IAAI,aACb,wBAAC,WAAI,eACH,4CAAQ,KAAK,GAAS,EACtB,uBAAC,WAAI,IACH,UAAU,EAAC,OAAO,EAClB,kBAAkB,EAAC,SAAS,EAC5B,OAAO,EAAE;4BACP,GAAG,EAAE,wFAAwF;4BAC7F,MAAM,EAAE,OAAO;y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ACL,KAAK,EAAE,MAAM;iBACd,YAED,uBAAC,OAAO,KAAG,GACP,CACP,EAEA,QAAQ,EAET,uBAAC,MAAM,KAAG,IACT,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,CACnB,6DACE,uBAAC,OAAE,IACD,KAAK,EAAE;gBACL,SAAS,EAAE,MAAM;gBACjB,YAAY,EAAE,MAAM;aACrB,GACD,EAEF,wBAAC,WAAI,IACH,KAAK,EAAE;gBACL,KAAK,EAAE,SAAS;aACjB,wBAEE,IAAA,WAAG,GAAE,CAAC,IAAI,EAAE,sDACV,EACP,uBAAC,WAAI,IACH,KAAK,EAAE;gBACL,KAAK,EAAE,SAAS;aACjB,4IAII,IACN,CACJ,CAAC;AAEF,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CACpB,iCACE,KAAK,EAAC,MAAM,EACZ,MAAM,EAAC,MAAM,EACb,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,aAElC,iCACE,CAAC,EAAC,mNAAmN,EACrN,IAAI,EAAC,SAAS,GACd,EACF,iCACE,CAAC,EAAC,gUAAgU,EAClU,IAAI,EAAC,SAAS,EACd,WAAW,EAAC,KAAK,GACjB,EACF,iCACE,CAAC,EAAC,4WAA4W,EAC9W,IAAI,EAAC,SAAS,GACd,IACE,CACP,CAAC","sourcesContent":["import { Body } from '@react-email/body';\nimport { Font } from '@react-email/font';\nimport { Head } from '@react-email/head';\nimport { Hr } from '@react-email/hr';\nimport { Html } from '@react-email/html';\nimport { Img } from '@react-email/img';\nimport { Preview } from '@react-email/preview';\nimport { Text } from '@react-email/text';\nimport { day } from '@vrplatform/utils';\nimport type { EmailBaseProps } from '../types';\n\ntype Props = {\n children: React.ReactNode;\n title: string;\n tenant: Omit<EmailBaseProps['tenant'], 'name'>;\n mode: EmailBaseProps['mode'];\n shortDescription?: string;\n};\n\nexport const EmailContainer = (props: Props) => {\n const { children, shortDescription, title } = props;\n\n const contentWrapperStyle = {\n paddingInline: '20px',\n paddingBlock: '10px',\n maxWidth: '500px',\n margin: '0 auto',\n };\n\n if (props.mode !== 'send') {\n return (\n <div style={contentWrapperStyle}>\n <Content {...props}>{children}</Content>\n </div>\n );\n }\n\n return (\n <Html lang=\"en\">\n <Head>\n <title>{title}</title>\n <Font\n fontFamily=\"Inter\"\n fallbackFontFamily=\"Verdana\"\n webFont={{\n url: 'https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7W0Q5nw.woff2',\n format: 'woff2',\n }}\n fontWeight={400}\n fontStyle=\"normal\"\n />\n <Font\n fontFamily=\"Inter\"\n fallbackFontFamily=\"Verdana\"\n webFont={{\n url: 'https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7W0Q5nw.woff2',\n format: 'woff2',\n }}\n fontWeight={600}\n fontStyle=\"normal\"\n />\n </Head>\n {shortDescription && <Preview>{shortDescription}</Preview>}\n <Body style={contentWrapperStyle}>\n <Content {...props}>{children}</Content>\n </Body>\n </Html>\n );\n};\n\nconst Content = ({ children, tenant: { logo: tenantLogo }, mode }: Props) => {\n return (\n <>\n {tenantLogo ? (\n <div\n style={{\n marginBottom: '60px',\n padding: '5px',\n // border: '1px solid rgb(233,236,239)',\n borderRadius: '5px',\n width: '80px',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Img src={tenantLogo} alt={'Logo'} width={70} />\n </div>\n ) : mode === 'send' ? (\n <Img\n src={'https://staging.portal.vrplatform.app/logo.png'}\n alt={'Logo'}\n width={70}\n style={{ marginBottom: '60px' }}\n />\n ) : (\n <div\n style={{\n width: '60px',\n }}\n >\n <VrpLogo />\n </div>\n )}\n\n {children}\n\n <Footer />\n </>\n );\n};\n\nconst Footer = () => (\n <>\n <Hr\n style={{\n marginTop: '30px',\n marginBottom: '50px',\n }}\n />\n\n <Text\n style={{\n color: '#737373',\n }}\n >\n © {day().year()} VRPlatform Ventures Ltd. All rights reserved.\n </Text>\n <Text\n style={{\n color: '#737373',\n }}\n >\n VR Technologies, LLC, a company incorporated and registered in the United\n States of America with company number 20201965158\n </Text>\n </>\n);\n\nconst VrpLogo = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 28 29\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M18.2549 8.25161C18.2549 5.89704 20.1636 3.98828 22.5182 3.98828C24.8728 3.98828 26.7815 5.89704 26.7815 8.25161C26.7815 10.6062 24.8728 12.5149 22.5182 12.5149C20.1636 12.5149 18.2549 10.6062 18.2549 8.25161Z\"\n fill=\"#172554\"\n />\n <path\n d=\"M7.02441 8.46593C7.02441 6.01867 9.20858 3.99805 11.6558 3.99805C14.1031 3.99805 15.0558 5.59785 16.5612 7.52728C17.1957 8.34054 20.7921 13.3413 20.7921 13.3413C20.7921 13.3413 21.566 14.6863 21.566 15.7894C21.566 18.5287 17.1993 22.8381 17.1993 22.8381L7.66841 10.6799C7.66841 10.6799 7.02441 10.0502 7.02441 8.46593Z\"\n fill=\"#172554\"\n fillOpacity=\"0.8\"\n />\n <path\n d=\"M1.24707 8.42687C1.24707 5.97961 3.43123 3.95898 5.8785 3.95898C8.32576 3.95898 9.27845 5.55879 10.7839 7.48824C11.4184 8.30147 14.6041 12.4888 16.8247 15.5727C18.3585 17.703 18.474 17.705 18.474 20.3439C18.474 22.9827 15.1592 24.1379 14.1483 24.1914C12.0203 24.304 10.5418 22.4681 10.5418 22.4681L1.89106 10.6408C1.89106 10.6408 1.24707 10.0111 1.24707 8.42687Z\"\n fill=\"#172554\"\n />\n </svg>\n);\n"]}
1
+ {"version":3,"file":"EmailContainer.js","sourceRoot":"src/","sources":["components/EmailContainer.tsx"],"names":[],"mappings":";;;;AAAA,4CAAyC;AACzC,4CAAyC;AACzC,4CAAyC;AACzC,wCAAqC;AACrC,4CAAyC;A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AM,OAAO,GAAG,GAAG,EAAE,CAAC,CACpB,iCACE,KAAK,EAAC,MAAM,EACZ,MAAM,EAAC,MAAM,EACb,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,aAElC,iCACE,CAAC,EAAC,mNAAmN,EACrN,IAAI,EAAC,SAAS,GACd,EACF,iCACE,CAAC,EAAC,gUAAgU,EAClU,IAAI,EAAC,SAAS,EACd,WAAW,EAAC,KAAK,GACjB,EACF,iCACE,CAAC,EAAC,4WAA4W,EAC9W,IAAI,EAAC,SAAS,GACd,IACE,CACP,CAAC","sourcesContent":["import { Body } from '@react-email/body';\nimport { Font } from '@react-email/font';\nimport { Head } from '@react-email/head';\nimport { Hr } from '@react-email/hr';\nimport { Html } from '@react-email/html';\nimport { Img } from '@react-email/img';\nimport { Preview } from '@react-email/preview';\nimport { Text } from '@react-email/text';\nimport { day } from '@vrplatform/utils';\nimport type { EmailBaseProps } from '../types';\n\ntype Props = {\n children: React.ReactNode;\n title: string;\n tenant: Omit<EmailBaseProps['tenant'], 'name'>;\n mode: EmailBaseProps['mode'];\n shortDescription?: string;\n};\n\nexport const EmailContainer = (props: Props) => {\n const { children, shortDescription, title } = props;\n\n const contentWrapperStyle = {\n paddingInline: '20px',\n paddingBlock: '10px',\n maxWidth: '500px',\n margin: '0 auto',\n };\n\n if (props.mode !== 'send') {\n return (\n <div style={contentWrapperStyle}>\n <Content {...props}>{children}</Content>\n </div>\n );\n }\n\n return (\n <Html lang=\"en\">\n <Head>\n <title>{title}</title>\n <Font\n fontFamily=\"Inter\"\n fallbackFontFamily=\"Verdana\"\n webFont={{\n url: 'https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7W0Q5nw.woff2',\n format: 'woff2',\n }}\n fontWeight={400}\n fontStyle=\"normal\"\n />\n <Font\n fontFamily=\"Inter\"\n fallbackFontFamily=\"Verdana\"\n webFont={{\n url: 'https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7W0Q5nw.woff2',\n format: 'woff2',\n }}\n fontWeight={600}\n fontStyle=\"normal\"\n />\n </Head>\n {shortDescription && <Preview>{shortDescription}</Preview>}\n <Body style={contentWrapperStyle}>\n <Content {...props}>{children}</Content>\n </Body>\n </Html>\n );\n};\n\nconst Content = ({ children, tenant: { logo: tenantLogo }, mode }: Props) => {\n return (\n <>\n {tenantLogo ? (\n <div\n style={{\n marginBottom: '60px',\n padding: '5px',\n // border: '1px solid rgb(233,236,239)',\n borderRadius: '5px',\n width: '80px',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Img src={tenantLogo} alt={'Logo'} width={70} />\n </div>\n ) : mode === 'send' ? (\n <Img\n src={'https://staging.portal.vrplatform.app/logo.png'}\n alt={'Logo'}\n width={70}\n style={{ marginBottom: '60px' }}\n />\n ) : (\n <div\n style={{\n width: '60px',\n }}\n >\n <VrpLogo />\n </div>\n )}\n\n {children}\n\n <Footer />\n </>\n );\n};\n\nconst Footer = () => (\n <>\n <Hr\n style={{\n marginTop: '30px',\n marginBottom: '50px',\n }}\n />\n\n <Text\n style={{\n color: '#737373',\n }}\n >\n © {day().year()} VR Technologies. All rights reserved.\n </Text>\n <Text\n style={{\n color: '#737373',\n }}\n >\n VR Technologies, LLC, a company incorporated and registered in the United\n States of America with company number 20201965158\n </Text>\n </>\n);\n\nconst VrpLogo = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 28 29\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M18.2549 8.25161C18.2549 5.89704 20.1636 3.98828 22.5182 3.98828C24.8728 3.98828 26.7815 5.89704 26.7815 8.25161C26.7815 10.6062 24.8728 12.5149 22.5182 12.5149C20.1636 12.5149 18.2549 10.6062 18.2549 8.25161Z\"\n fill=\"#172554\"\n />\n <path\n d=\"M7.02441 8.46593C7.02441 6.01867 9.20858 3.99805 11.6558 3.99805C14.1031 3.99805 15.0558 5.59785 16.5612 7.52728C17.1957 8.34054 20.7921 13.3413 20.7921 13.3413C20.7921 13.3413 21.566 14.6863 21.566 15.7894C21.566 18.5287 17.1993 22.8381 17.1993 22.8381L7.66841 10.6799C7.66841 10.6799 7.02441 10.0502 7.02441 8.46593Z\"\n fill=\"#172554\"\n fillOpacity=\"0.8\"\n />\n <path\n d=\"M1.24707 8.42687C1.24707 5.97961 3.43123 3.95898 5.8785 3.95898C8.32576 3.95898 9.27845 5.55879 10.7839 7.48824C11.4184 8.30147 14.6041 12.4888 16.8247 15.5727C18.3585 17.703 18.474 17.705 18.474 20.3439C18.474 22.9827 15.1592 24.1379 14.1483 24.1914C12.0203 24.304 10.5418 22.4681 10.5418 22.4681L1.89106 10.6408C1.89106 10.6408 1.24707 10.0111 1.24707 8.42687Z\"\n fill=\"#172554\"\n />\n </svg>\n);\n"]}
@@ -3,4 +3,6 @@ export declare const getDefaultInviteOwnerEmailData: (mode: "tag" | "text", args
3
3
  appName: string;
4
4
  signInLink: string;
5
5
  }) => ActionEmailData;
6
- export declare const InviteOwnerEmailTemplate: (props: ActionEmailTemplateProps) => import("react").JSX.Element;
6
+ export declare const InviteOwnerEmailTemplate: ({ ownerAccessRole, ...props }: ActionEmailTemplateProps & {
7
+ ownerAccessRole?: "admin" | "viewer";
8
+ }) => import("react").JSX.Element;
@@ -7,18 +7,22 @@ const components_1 = require("../components");
7
7
  const getDefaultInviteOwnerEmailData = (mode, args) => {
8
8
  const signInLink = mode === 'tag' ? extensions_1.EMAIL_ACTION_LINK_COMPONENT : args.signInLink;
9
9
  return {
10
- bodyOne: `<p>You are invited to join us on ${args.appName}.</p><p>To start using ${args.appName}, accept the invitation and verify your email address.</p>`,
10
+ bodyOne: `<p>You are invited to access your Owner Portal on ${args.appName}.</p><p>Accept the invitation below to set up your access.</p>`,
11
11
  bodyTwo: `<p>If you have any trouble with the button, you can copy and paste the link below into your browser: ${signInLink}</p>`,
12
12
  buttonText: 'Accept Invitation',
13
- header: 'Welcome to the team!',
14
- shortDescription: 'You have been invited to join the team. To start using VRPlatform, verify your email address at link below.',
13
+ header: 'Welcome to your Owner Portal!',
14
+ shortDescription: 'Set up your Owner Portal access using your invitation.',
15
15
  href: args.signInLink,
16
- subject: `You are invited to join your team on ${args.appName}`,
16
+ subject: `Your invitation to the ${args.appName} Owner Portal`,
17
17
  };
18
18
  };
19
19
  exports.getDefaultInviteOwnerEmailData = getDefaultInviteOwnerEmailData;
20
- const InviteOwnerEmailTemplate = (props) => {
21
- return (0, jsx_runtime_1.jsx)(components_1.ActionEmailTemplate, { ...props });
20
+ const InviteOwnerEmailTemplate = ({ ownerAccessRole = 'admin', ...props }) => {
21
+ return ((0, jsx_runtime_1.jsx)(components_1.ActionEmailTemplate, { ...props, data: {
22
+ ...props.data,
23
+ // Add guidance at render time so saved custom templates receive it too.
24
+ bodyTwo: `${props.data.bodyTwo}<hr style="width:100%;border:none;border-top:1px solid #eaeaea;margin:24px 0" /><p>This invitation link is for one-time setup of your Owner Portal access and expires after 7 days. Sign up using the exact email address this invitation was sent to.</p><p>If your invitation expires before setup is complete, contact your property manager for a new invitation.</p><p>For questions about ${ownerAccessRole === 'viewer' ? 'portal access' : 'your statements or portal access'}, contact your property manager.</p>`,
25
+ } }));
22
26
  };
23
27
  exports.InviteOwnerEmailTemplate = InviteOwnerEmailTemplate;
24
28
  //# sourceMappingURL=InviteOwnerEmailTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InviteOwnerEmailTemplate.js","sourceRoot":"src/","sources":["templates/InviteOwnerEmailTemplate.tsx"],"names":[],"mappings":";;;;AAAA,8CAA4D;AAC5D,8CAIuB;AAEhB,MAAM,8BAA8B,GAAG,CAC5C,IAAoB,EACpB,IAGC,EACgB,EAAE;IACnB,MAAM,UAAU,GACd,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,wCAA2B,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;IAEjE,OAAO;QACL,OAAO,EAAE,oCAAoC,IAAI,CAAC,OAAO,0BAA0B,IAAI,CAAC,OAAO,4DAA4D;QAC3J,OAAO,EAAE,wGAAwG,UAAU,MAAM;QACjI,UAAU,EAAE,mBAAmB;QAC/B,MAAM,EAAE,sBAAsB;QAC9B,gBAAgB,EACd,6GAA6G;QAC/G,IAAI,EAAE,IAAI,CAAC,UAAU;QACrB,OAAO,EAAE,wCAAwC,IAAI,CAAC,OAAO,EAAE;KAChE,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,8BAA8B,kCAoBzC;AAEK,MAAM,wBAAwB,GAAG,CAAC,KAA+B,EAAE,EAAE;IAC1E,OAAO,uBAAC,gCAAmB,OAAK,KAAK,GAAI,CAAC;AAC5C,CAAC,CAAC;AAFW,QAAA,wBAAwB,4BAEnC","sourcesContent":["import { EMAIL_ACTION_LINK_COMPONENT } from '../extensions';\nimport {\n type ActionEmailData,\n ActionEmailTemplate,\n type ActionEmailTemplateProps,\n} from '../components';\n\nexport const getDefaultInviteOwnerEmailData = (\n mode: 'tag' | 'text',\n args: {\n appName: string;\n signInLink: string;\n }\n): ActionEmailData => {\n const signInLink =\n mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.signInLink;\n\n return {\n bodyOne: `<p>You are invited to join us on ${args.appName}.</p><p>To start using ${args.appName}, accept the invitation and verify your email address.</p>`,\n bodyTwo: `<p>If you have any trouble with the button, you can copy and paste the link below into your browser: ${signInLink}</p>`,\n buttonText: 'Accept Invitation',\n header: 'Welcome to the team!',\n shortDescription:\n 'You have been invited to join the team. To start using VRPlatform, verify your email address at link below.',\n href: args.signInLink,\n subject: `You are invited to join your team on ${args.appName}`,\n };\n};\n\nexport const InviteOwnerEmailTemplate = (props: ActionEmailTemplateProps) => {\n return <ActionEmailTemplate {...props} />;\n};\n"]}
1
+ {"version":3,"file":"InviteOwnerEmailTemplate.js","sourceRoot":"src/","sources":["templates/InviteOwnerEmailTemplate.tsx"],"names":[],"mappings":";;;;AAAA,8CAA4D;AAC5D,8CAIuB;AAEhB,MAAM,8BAA8B,GAAG,CAC5C,IAAoB,EACpB,IAGC,EACgB,EAAE;IACnB,MAAM,UAAU,GACd,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,wCAA2B,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;IAEjE,OAAO;QACL,OAAO,EAAE,qDAAqD,IAAI,CAAC,OAAO,gEAAgE;QAC1I,OAAO,EAAE,wGAAwG,UAAU,MAAM;QACjI,UAAU,EAAE,mBAAmB;QAC/B,MAAM,EAAE,+BAA+B;QACvC,gBAAgB,EAAE,wDAAwD;QAC1E,IAAI,EAAE,IAAI,CAAC,UAAU;QACrB,OAAO,EAAE,0BAA0B,IAAI,CAAC,OAAO,eAAe;KAC/D,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,8BAA8B,kCAmBzC;AAEK,MAAM,wBAAwB,GAAG,CAAC,EACvC,eAAe,GAAG,OAAO,EACzB,GAAG,KAAK,EAGT,EAAE,EAAE;IACH,OAAO,CACL,uBAAC,gCAAmB,OACd,KAAK,EACT,IAAI,EAAE;YACJ,GAAG,KAAK,CAAC,IAAI;YACb,wEAAwE;YACxE,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,mYAAmY,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,kCAAkC,sCAAsC;SAC3hB,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,wBAAwB,4BAgBnC","sourcesContent":["import { EMAIL_ACTION_LINK_COMPONENT } from '../extensions';\nimport {\n type ActionEmailData,\n ActionEmailTemplate,\n type ActionEmailTemplateProps,\n} from '../components';\n\nexport const getDefaultInviteOwnerEmailData = (\n mode: 'tag' | 'text',\n args: {\n appName: string;\n signInLink: string;\n }\n): ActionEmailData => {\n const signInLink =\n mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.signInLink;\n\n return {\n bodyOne: `<p>You are invited to access your Owner Portal on ${args.appName}.</p><p>Accept the invitation below to set up your access.</p>`,\n bodyTwo: `<p>If you have any trouble with the button, you can copy and paste the link below into your browser: ${signInLink}</p>`,\n buttonText: 'Accept Invitation',\n header: 'Welcome to your Owner Portal!',\n shortDescription: 'Set up your Owner Portal access using your invitation.',\n href: args.signInLink,\n subject: `Your invitation to the ${args.appName} Owner Portal`,\n };\n};\n\nexport const InviteOwnerEmailTemplate = ({\n ownerAccessRole = 'admin',\n ...props\n}: ActionEmailTemplateProps & {\n ownerAccessRole?: 'admin' | 'viewer';\n}) => {\n return (\n <ActionEmailTemplate\n {...props}\n data={{\n ...props.data,\n // Add guidance at render time so saved custom templates receive it too.\n bodyTwo: `${props.data.bodyTwo}<hr style=\"width:100%;border:none;border-top:1px solid #eaeaea;margin:24px 0\" /><p>This invitation link is for one-time setup of your Owner Portal access and expires after 7 days. Sign up using the exact email address this invitation was sent to.</p><p>If your invitation expires before setup is complete, contact your property manager for a new invitation.</p><p>For questions about ${ownerAccessRole === 'viewer' ? 'portal access' : 'your statements or portal access'}, contact your property manager.</p>`,\n }}\n />\n );\n};\n"]}
@@ -9,18 +9,22 @@ const getDefaultInvitePropertyManagerEmailData = (mode, args) => {
9
9
  ? extensions_1.EMAIL_ACTION_LINK_COMPONENT
10
10
  : `<a href='${args.signInLink}' target='_blank'>${args.signInLink}</a>`;
11
11
  return {
12
- bodyOne: `<p>You are invited to join us on ${args.appName}.</p><p>To start using ${args.appName}, accept the invitation and verify your email address.</p>`,
12
+ bodyOne: `<p>You are invited to join us on ${args.appName}.</p><p>Accept the invitation below to set up your team access.</p>`,
13
13
  bodyTwo: `<p>If you have any trouble with the button, you can use the following link below: ${signInLink}</p>`,
14
14
  buttonText: 'Accept Invitation',
15
15
  header: 'Welcome to the team!',
16
- shortDescription: 'You have been invited to join the team. To start using VRPlatform, verify your email address at link below.',
16
+ shortDescription: `Accept your invitation to join your team on ${args.appName}.`,
17
17
  href: args.signInLink,
18
18
  subject: `You are invited to join your team on ${args.appName}`,
19
19
  };
20
20
  };
21
21
  exports.getDefaultInvitePropertyManagerEmailData = getDefaultInvitePropertyManagerEmailData;
22
22
  const InvitePmEmailTemplate = (props) => {
23
- return ((0, jsx_runtime_1.jsx)(components_1.ActionEmailTemplate, { ...props, tenant: {
23
+ return ((0, jsx_runtime_1.jsx)(components_1.ActionEmailTemplate, { ...props, data: {
24
+ ...props.data,
25
+ // Add guidance at render time so saved custom templates receive it too.
26
+ bodyTwo: `${props.data.bodyTwo}<hr style="width:100%;border:none;border-top:1px solid #eaeaea;margin:24px 0" /><p>This invitation link is for one-time setup of your team access and expires after 7 days. Sign up using the exact email address this invitation was sent to.</p><p>If your invitation expires before setup is complete, contact your team administrator for a new invitation.</p><p>For questions about team access, contact your team administrator.</p>`,
27
+ }, tenant: {
24
28
  logo: undefined,
25
29
  name: props.tenant.name,
26
30
  } }));
@@ -1 +1 @@
1
- {"version":3,"file":"InvitePmEmailTemplate.js","sourceRoot":"src/","sources":["templates/InvitePmEmailTemplate.tsx"],"names":[],"mappings":";;;;AAAA,8CAA4D;AAC5D,8CAIuB;AAEhB,MAAM,wCAAwC,GAAG,CACtD,IAAoB,EACpB,IAGC,EACgB,EAAE;IACnB,MAAM,UAAU,GACd,IAAI,KAAK,KAAK;QACZ,CAAC,CAAC,wCAA2B;QAC7B,CAAC,CAAC,YAAY,IAAI,CAAC,UAAU,qBAAqB,IAAI,CAAC,UAAU,MAAM,CAAC;IAE5E,OAAO;QACL,OAAO,EAAE,oCAAoC,IAAI,CAAC,OAAO,0BAA0B,IAAI,CAAC,OAAO,4DAA4D;QAC3J,OAAO,EAAE,qFAAqF,UAAU,MAAM;QAC9G,UAAU,EAAE,mBAAmB;QAC/B,MAAM,EAAE,sBAAsB;QAC9B,gBAAgB,EACd,6GAA6G;QAC/G,IAAI,EAAE,IAAI,CAAC,UAAU;QACrB,OAAO,EAAE,wCAAwC,IAAI,CAAC,OAAO,EAAE;KAChE,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,wCAAwC,4CAsBnD;AAEK,MAAM,qBAAqB,GAAG,CAAC,KAA+B,EAAE,EAAE;IACvE,OAAO,CACL,uBAAC,gCAAmB,OACd,KAAK,EACT,MAAM,EAAE;YACN,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;SACxB,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,qBAAqB,yBAUhC","sourcesContent":["import { EMAIL_ACTION_LINK_COMPONENT } from '../extensions';\nimport {\n type ActionEmailData,\n ActionEmailTemplate,\n type ActionEmailTemplateProps,\n} from '../components';\n\nexport const getDefaultInvitePropertyManagerEmailData = (\n mode: 'tag' | 'text',\n args: {\n appName: string;\n signInLink: string;\n }\n): ActionEmailData => {\n const signInLink =\n mode === 'tag'\n ? EMAIL_ACTION_LINK_COMPONENT\n : `<a href='${args.signInLink}' target='_blank'>${args.signInLink}</a>`;\n\n return {\n bodyOne: `<p>You are invited to join us on ${args.appName}.</p><p>To start using ${args.appName}, accept the invitation and verify your email address.</p>`,\n bodyTwo: `<p>If you have any trouble with the button, you can use the following link below: ${signInLink}</p>`,\n buttonText: 'Accept Invitation',\n header: 'Welcome to the team!',\n shortDescription:\n 'You have been invited to join the team. To start using VRPlatform, verify your email address at link below.',\n href: args.signInLink,\n subject: `You are invited to join your team on ${args.appName}`,\n };\n};\n\nexport const InvitePmEmailTemplate = (props: ActionEmailTemplateProps) => {\n return (\n <ActionEmailTemplate\n {...props}\n tenant={{\n logo: undefined,\n name: props.tenant.name,\n }}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"InvitePmEmailTemplate.js","sourceRoot":"src/","sources":["templates/InvitePmEmailTemplate.tsx"],"names":[],"mappings":";;;;AAAA,8CAA4D;AAC5D,8CAIuB;AAEhB,MAAM,wCAAwC,GAAG,CACtD,IAAoB,EACpB,IAGC,EACgB,EAAE;IACnB,MAAM,UAAU,GACd,IAAI,KAAK,KAAK;QACZ,CAAC,CAAC,wCAA2B;QAC7B,CAAC,CAAC,YAAY,IAAI,CAAC,UAAU,qBAAqB,IAAI,CAAC,UAAU,MAAM,CAAC;IAE5E,OAAO;QACL,OAAO,EAAE,oCAAoC,IAAI,CAAC,OAAO,qEAAqE;QAC9H,OAAO,EAAE,qFAAqF,UAAU,MAAM;QAC9G,UAAU,EAAE,mBAAmB;QAC/B,MAAM,EAAE,sBAAsB;QAC9B,gBAAgB,EAAE,+CAA+C,IAAI,CAAC,OAAO,GAAG;QAChF,IAAI,EAAE,IAAI,CAAC,UAAU;QACrB,OAAO,EAAE,wCAAwC,IAAI,CAAC,OAAO,EAAE;KAChE,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,wCAAwC,4CAqBnD;AAEK,MAAM,qBAAqB,GAAG,CAAC,KAA+B,EAAE,EAAE;IACvE,OAAO,CACL,uBAAC,gCAAmB,OACd,KAAK,EACT,IAAI,EAAE;YACJ,GAAG,KAAK,CAAC,IAAI;YACb,wEAAwE;YACxE,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,6aAA6a;SAC5c,EACD,MAAM,EAAE;YACN,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;SACxB,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,qBAAqB,yBAehC","sourcesContent":["import { EMAIL_ACTION_LINK_COMPONENT } from '../extensions';\nimport {\n type ActionEmailData,\n ActionEmailTemplate,\n type ActionEmailTemplateProps,\n} from '../components';\n\nexport const getDefaultInvitePropertyManagerEmailData = (\n mode: 'tag' | 'text',\n args: {\n appName: string;\n signInLink: string;\n }\n): ActionEmailData => {\n const signInLink =\n mode === 'tag'\n ? EMAIL_ACTION_LINK_COMPONENT\n : `<a href='${args.signInLink}' target='_blank'>${args.signInLink}</a>`;\n\n return {\n bodyOne: `<p>You are invited to join us on ${args.appName}.</p><p>Accept the invitation below to set up your team access.</p>`,\n bodyTwo: `<p>If you have any trouble with the button, you can use the following link below: ${signInLink}</p>`,\n buttonText: 'Accept Invitation',\n header: 'Welcome to the team!',\n shortDescription: `Accept your invitation to join your team on ${args.appName}.`,\n href: args.signInLink,\n subject: `You are invited to join your team on ${args.appName}`,\n };\n};\n\nexport const InvitePmEmailTemplate = (props: ActionEmailTemplateProps) => {\n return (\n <ActionEmailTemplate\n {...props}\n data={{\n ...props.data,\n // Add guidance at render time so saved custom templates receive it too.\n bodyTwo: `${props.data.bodyTwo}<hr style=\"width:100%;border:none;border-top:1px solid #eaeaea;margin:24px 0\" /><p>This invitation link is for one-time setup of your team access and expires after 7 days. Sign up using the exact email address this invitation was sent to.</p><p>If your invitation expires before setup is complete, contact your team administrator for a new invitation.</p><p>For questions about team access, contact your team administrator.</p>`,\n }}\n tenant={{\n logo: undefined,\n name: props.tenant.name,\n }}\n />\n );\n};\n"]}
@@ -0,0 +1,8 @@
1
+ export declare function findPostmarkEmail(deliveryId: string, options: {
2
+ fetch?: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
3
+ postmarkToken?: string;
4
+ }): Promise<{
5
+ httpStatus: number;
6
+ messageId: any;
7
+ submittedAt: any;
8
+ } | undefined>;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findPostmarkEmail = findPostmarkEmail;
4
+ const utils_1 = require("@vrplatform/utils");
5
+ const send_email_1 = require("./send-email");
6
+ async function findPostmarkEmail(deliveryId, options) {
7
+ if (!options.postmarkToken) {
8
+ throw new send_email_1.EmailDeliveryError('Postmark is not configured', undefined, false, false);
9
+ }
10
+ const url = new URL('https://api.postmarkapp.com/messages/outbound');
11
+ url.searchParams.set('count', '1');
12
+ url.searchParams.set('offset', '0');
13
+ url.searchParams.set('messagestream', 'outbound');
14
+ url.searchParams.set('metadata_deliveryId', deliveryId);
15
+ const response = await (options.fetch ?? fetch)(url, {
16
+ method: 'GET',
17
+ headers: {
18
+ Accept: 'application/json',
19
+ 'X-Postmark-Server-Token': options.postmarkToken,
20
+ },
21
+ });
22
+ const providerResponse = await response.json().catch(() => ({}));
23
+ if (!response.ok) {
24
+ throw new send_email_1.EmailDeliveryError('Postmark message lookup failed', {
25
+ provider: 'postmark',
26
+ providerCategory: 'rejected',
27
+ httpStatus: response.status,
28
+ }, false, response.status === 429 || response.status >= 500);
29
+ }
30
+ if (!providerResponse ||
31
+ typeof providerResponse !== 'object' ||
32
+ !('TotalCount' in providerResponse) ||
33
+ typeof providerResponse.TotalCount !== 'number' ||
34
+ !('Messages' in providerResponse) ||
35
+ !Array.isArray(providerResponse.Messages)) {
36
+ throw new send_email_1.EmailDeliveryError('Postmark returned an invalid response');
37
+ }
38
+ if (providerResponse.TotalCount === 0)
39
+ return undefined;
40
+ const message = providerResponse.Messages.find((value) => value &&
41
+ typeof value === 'object' &&
42
+ 'Metadata' in value &&
43
+ value.Metadata &&
44
+ typeof value.Metadata === 'object' &&
45
+ 'deliveryId' in value.Metadata &&
46
+ value.Metadata.deliveryId === deliveryId);
47
+ const messageId = message &&
48
+ typeof message === 'object' &&
49
+ 'MessageID' in message &&
50
+ typeof message.MessageID === 'string' &&
51
+ message.MessageID
52
+ ? message.MessageID
53
+ : undefined;
54
+ const submittedAt = message &&
55
+ typeof message === 'object' &&
56
+ 'ReceivedAt' in message &&
57
+ typeof message.ReceivedAt === 'string' &&
58
+ (0, utils_1.day)(message.ReceivedAt).isValid()
59
+ ? message.ReceivedAt
60
+ : undefined;
61
+ if (!messageId || !submittedAt) {
62
+ throw new send_email_1.EmailDeliveryError('Postmark returned an invalid response');
63
+ }
64
+ return { httpStatus: response.status, messageId, submittedAt };
65
+ }
66
+ //# sourceMappingURL=find-postmark-email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-postmark-email.js","sourceRoot":"src/","sources":["utils/find-postmark-email.ts"],"names":[],"mappings":";;AAGA,8CAyFC;AA5FD,6CAAwC;AACxC,6CAAkD;AAE3C,KAAK,UAAU,iBA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C,uCAAuC,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AACjE,CAAC","sourcesContent":["import { day } from '@vrplatform/utils';\nimport { EmailDeliveryError } from './send-email';\n\nexport async function findPostmarkEmail(\n deliveryId: string,\n options: {\n fetch?: (\n input: string | URL | Request,\n init?: RequestInit\n ) => Promise<Response>;\n postmarkToken?: string;\n }\n) {\n if (!options.postmarkToken) {\n throw new EmailDeliveryError(\n 'Postmark is not configured',\n undefined,\n false,\n false\n );\n }\n\n const url = new URL('https://api.postmarkapp.com/messages/outbound');\n url.searchParams.set('count', '1');\n url.searchParams.set('offset', '0');\n url.searchParams.set('messagestream', 'outbound');\n url.searchParams.set('metadata_deliveryId', deliveryId);\n const response = await (options.fetch ?? fetch)(url, {\n method: 'GET',\n headers: {\n Accept: 'application/json',\n 'X-Postmark-Server-Token': options.postmarkToken,\n },\n });\n const providerResponse: unknown = await response.json().catch(() => ({}));\n\n if (!response.ok) {\n throw new EmailDeliveryError(\n 'Postmark message lookup failed',\n {\n provider: 'postmark',\n providerCategory: 'rejected',\n httpStatus: response.status,\n },\n false,\n response.status === 429 || response.status >= 500\n );\n }\n\n if (\n !providerResponse ||\n typeof providerResponse !== 'object' ||\n !('TotalCount' in providerResponse) ||\n typeof providerResponse.TotalCount !== 'number' ||\n !('Messages' in providerResponse) ||\n !Array.isArray(providerResponse.Messages)\n ) {\n throw new EmailDeliveryError('Postmark returned an invalid response');\n }\n if (providerResponse.TotalCount === 0) return undefined;\n\n const message = providerResponse.Messages.find(\n (value) =>\n value &&\n typeof value === 'object' &&\n 'Metadata' in value &&\n value.Metadata &&\n typeof value.Metadata === 'object' &&\n 'deliveryId' in value.Metadata &&\n value.Metadata.deliveryId === deliveryId\n );\n const messageId =\n message &&\n typeof message === 'object' &&\n 'MessageID' in message &&\n typeof message.MessageID === 'string' &&\n message.MessageID\n ? message.MessageID\n : undefined;\n const submittedAt =\n message &&\n typeof message === 'object' &&\n 'ReceivedAt' in message &&\n typeof message.ReceivedAt === 'string' &&\n day(message.ReceivedAt).isValid()\n ? message.ReceivedAt\n : undefined;\n if (!messageId || !submittedAt) {\n throw new EmailDeliveryError('Postmark returned an invalid response');\n }\n\n return { httpStatus: response.status, messageId, submittedAt };\n}\n"]}
@@ -1 +1,3 @@
1
+ export * from './find-postmark-email';
2
+ export * from './find-postmark-email';
1
3
  export * from './send-email';
@@ -14,5 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./find-postmark-email"), exports);
18
+ __exportStar(require("./find-postmark-email"), exports);
17
19
  __exportStar(require("./send-email"), exports);
18
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B","sourcesContent":["export * from './send-email';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,wDAAsC;AACtC,+CAA6B","sourcesContent":["export * from './find-postmark-email';\nexport * from './find-postmark-email';\nexport * from './send-email';\n"]}
@@ -1,7 +1,18 @@
1
+ type EmailDeliveryFailureDetails = {
2
+ httpStatus: number;
3
+ postmarkErrorCode?: number;
4
+ provider: 'postmark';
5
+ providerCategory: 'inactiveRecipient' | 'rejected';
6
+ };
7
+ type EmailDeliveryErrorDetails = EmailDeliveryFailureDetails | {
8
+ failureCount: number;
9
+ failures: EmailDeliveryFailureDetails[];
10
+ };
1
11
  export declare class EmailDeliveryError extends Error {
2
- readonly details?: Record<string, unknown> | undefined;
12
+ readonly details?: EmailDeliveryErrorDetails | undefined;
3
13
  readonly expected: boolean;
4
- constructor(message: string, details?: Record<string, unknown> | undefined, expected?: boolean);
14
+ readonly retryable: boolean;
15
+ constructor(message: string, details?: EmailDeliveryErrorDetails | undefined, expected?: boolean, retryable?: boolean);
5
16
  }
6
17
  export declare function sendEmail(data: {
7
18
  to: string;
@@ -9,9 +20,15 @@ export declare function sendEmail(data: {
9
20
  text: string;
10
21
  html: string;
11
22
  replyTo?: string;
23
+ tag?: string;
24
+ metadata?: Record<string, string>;
12
25
  }, options: {
13
26
  fetch?: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
14
27
  postmarkToken?: string;
15
28
  }): Promise<{
16
- status: number;
29
+ httpStatus: number;
30
+ messageId: string;
31
+ submittedAt: string;
17
32
  }>;
33
+ export declare function settleEmailDeliveries(deliveries: Promise<unknown>[]): Promise<void>;
34
+ export {};
@@ -2,18 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EmailDeliveryError = void 0;
4
4
  exports.sendEmail = sendEmail;
5
+ exports.settleEmailDeliveries = settleEmailDeliveries;
6
+ const utils_1 = require("@vrplatform/utils");
5
7
  class EmailDeliveryError extends Error {
6
- constructor(message, details, expected = false) {
8
+ constructor(message, details, expected = false, retryable = true) {
7
9
  super(message);
8
10
  this.details = details;
9
11
  this.expected = expected;
12
+ this.retryable = retryable;
10
13
  this.name = 'EmailDeliveryError';
11
14
  }
12
15
  }
13
16
  exports.EmailDeliveryError = EmailDeliveryError;
14
17
  async function sendEmail(data, options) {
15
18
  if (!options.postmarkToken) {
16
- throw new EmailDeliveryError('Postmark is not configured');
19
+ throw new EmailDeliveryError('Postmark is not configured', undefined, false, false);
17
20
  }
18
21
  const response = await (options.fetch ?? fetch)('https://api.postmarkapp.com/email', {
19
22
  method: 'POST',
@@ -30,30 +33,105 @@ async function sendEmail(data, options) {
30
33
  TextBody: data.text,
31
34
  HtmlBody: data.html,
32
35
  MessageStream: 'outbound',
36
+ Tag: data.tag,
37
+ Metadata: data.metadata,
33
38
  }),
34
39
  });
35
40
  const providerResponse = await response.json().catch(() => ({}));
36
- const providerMessage = providerResponse !== null &&
41
+ const responseErrorCode = providerResponse !== null &&
37
42
  typeof providerResponse === 'object' &&
38
- 'Message' in providerResponse &&
39
- typeof providerResponse.Message === 'string'
40
- ? providerResponse.Message
43
+ 'ErrorCode' in providerResponse &&
44
+ typeof providerResponse.ErrorCode === 'number'
45
+ ? providerResponse.ErrorCode
41
46
  : undefined;
42
- if (!response.ok) {
43
- if (response.status === 422 &&
44
- providerMessage?.includes('marked as inactive')) {
45
- throw new EmailDeliveryError('Postmark recipient is inactive', {
46
- providerMessage,
47
- status: response.status,
48
- statusText: response.statusText,
49
- }, true);
47
+ const headerErrorCode = response.headers.get('X-PM-ApiErrorCode');
48
+ const errorCode = responseErrorCode ??
49
+ (headerErrorCode && /^\d+$/.test(headerErrorCode)
50
+ ? Number(headerErrorCode)
51
+ : undefined);
52
+ const postmarkErrorCode = typeof errorCode === 'number' &&
53
+ Number.isSafeInteger(errorCode) &&
54
+ errorCode >= 0
55
+ ? errorCode
56
+ : undefined;
57
+ if (!response.ok ||
58
+ (postmarkErrorCode !== undefined && postmarkErrorCode !== 0)) {
59
+ const inactiveRecipient = response.status === 422 && postmarkErrorCode === 406;
60
+ const details = {
61
+ provider: 'postmark',
62
+ providerCategory: inactiveRecipient ? 'inactiveRecipient' : 'rejected',
63
+ httpStatus: response.status,
64
+ ...(postmarkErrorCode !== undefined ? { postmarkErrorCode } : {}),
65
+ };
66
+ if (inactiveRecipient) {
67
+ throw new EmailDeliveryError('Postmark recipient is inactive', details, true, false);
50
68
  }
51
- throw new EmailDeliveryError('Postmark rejected the email', {
52
- providerResponse,
53
- status: response.status,
54
- statusText: response.statusText,
69
+ throw new EmailDeliveryError('Postmark rejected the email', details, false, response.status === 429 || response.status >= 500);
70
+ }
71
+ const messageId = providerResponse !== null &&
72
+ typeof providerResponse === 'object' &&
73
+ 'MessageID' in providerResponse &&
74
+ typeof providerResponse.MessageID === 'string' &&
75
+ providerResponse.MessageID
76
+ ? providerResponse.MessageID
77
+ : undefined;
78
+ const submittedAt = providerResponse !== null &&
79
+ typeof providerResponse === 'object' &&
80
+ 'SubmittedAt' in providerResponse &&
81
+ typeof providerResponse.SubmittedAt === 'string' &&
82
+ (0, utils_1.day)(providerResponse.SubmittedAt).isValid()
83
+ ? providerResponse.SubmittedAt
84
+ : undefined;
85
+ if (!messageId || !submittedAt || postmarkErrorCode !== 0) {
86
+ throw new EmailDeliveryError('Postmark returned an invalid response', {
87
+ provider: 'postmark',
88
+ providerCategory: 'rejected',
89
+ httpStatus: response.status,
90
+ ...(postmarkErrorCode !== undefined ? { postmarkErrorCode } : {}),
55
91
  });
56
92
  }
57
- return { status: response.status };
93
+ return {
94
+ httpStatus: response.status,
95
+ messageId,
96
+ submittedAt,
97
+ };
98
+ }
99
+ async function settleEmailDeliveries(deliveries) {
100
+ const failures = (await Promise.allSettled(deliveries)).filter((result) => result.status === 'rejected');
101
+ if (failures.length === 0)
102
+ return;
103
+ const unexpectedDeliveryError = failures.find((failure) => failure.reason instanceof EmailDeliveryError && !failure.reason.expected)?.reason;
104
+ const allExpected = failures.every((failure) => failure.reason instanceof EmailDeliveryError && failure.reason.expected);
105
+ const firstDeliveryError = failures.find((failure) => failure.reason instanceof EmailDeliveryError)?.reason;
106
+ const failureDetails = failures.flatMap((failure) => {
107
+ if (!(failure.reason instanceof EmailDeliveryError) ||
108
+ !failure.reason.details ||
109
+ !('provider' in failure.reason.details)) {
110
+ return [];
111
+ }
112
+ const { httpStatus, postmarkErrorCode, provider, providerCategory } = failure.reason.details;
113
+ return [
114
+ {
115
+ httpStatus,
116
+ provider,
117
+ providerCategory,
118
+ ...(postmarkErrorCode !== undefined ? { postmarkErrorCode } : {}),
119
+ },
120
+ ];
121
+ });
122
+ const details = {
123
+ failureCount: failures.length,
124
+ failures: failureDetails,
125
+ };
126
+ if (unexpectedDeliveryError instanceof EmailDeliveryError) {
127
+ if (unexpectedDeliveryError.message === 'Postmark is not configured') {
128
+ throw new EmailDeliveryError('Postmark is not configured', details, false, false);
129
+ }
130
+ throw new EmailDeliveryError('Postmark rejected the email', details, false, unexpectedDeliveryError.retryable);
131
+ }
132
+ if (allExpected && firstDeliveryError instanceof EmailDeliveryError) {
133
+ throw new EmailDeliveryError('Postmark recipient is inactive', details, true, false);
134
+ }
135
+ throw new EmailDeliveryError('Email delivery failed', details);
58
136
  }
59
137
  //# sourceMappingURL=send-email.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"send-email.js","sourceRoot":"src/","sources":["utils/send-email.ts"],"names":[],"mappings":";;;AAWA,8BA0EC;AArFD,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YACE,OAAe,EACC,OAAiC,EACjC,WAAW,KAAK;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,YAAO,GAAP,OAAO,CAA0B;QACjC,aAAQ,GAAR,QAAQ,CAAQ;QAGhC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AATD,gDASC;AAEM,KAAK,UAAU,SAAS,CAC7B,IAMC,EACD,OAMC;IAED,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3B,MAAM,IAAI,kBAAkB,CAAC,4BAA4B,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,CAC7C,mCAAmC,EACnC;QACE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,MAAM,EAAE,kBAAkB;YAC1B,cAAc,EAAE,kBAAkB;YAClC,yBAAyB,EAAE,OAAO,CAAC,aAAa;SACjD;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,IAAI,EAAE,2CAA2C;YACjD,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,IAAI;YACnB,QAAQ,EAAE,IAAI,CAAC,IAAI;YACnB,aAAa,EAAE,UAAU;SAC1B,CAAC;KACH,CACF,CAAC;IAEF,MAAM,gBAAgB,GAAY,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,MAAM,eAAe,GACnB,gBAAgB,KAAK,IAAI;QACzB,OAAO,gBAAgB,KAAK,QAAQ;QACpC,SAAS,IAAI,gBAAgB;QAC7B,OAAO,gBAAgB,CAAC,OAAO,KAAK,QAAQ;QAC1C,CAAC,CAAC,gBAAgB,CAAC,OAAO;QAC1B,CAAC,CAAC,SAAS,CAAC;IAEhB,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,IACE,QAAQ,CAAC,MAAM,KAAK,GAAG;YACvB,eAAe,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAC/C,CAAC;YACD,MAAM,IAAI,kBAAkB,CAC1B,gCAAgC,EAChC;gBACE,eAAe;gBACf,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;aAChC,EACD,IAAI,CACL,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,kBAAkB,CAAC,6BAA6B,EAAE;YAC1D,gBAAgB;YAChB,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;SAChC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;AACrC,CAAC","sourcesContent":["export class EmailDeliveryError extends Error {\n constructor(\n message: string,\n public readonly details?: Record<string, unknown>,\n public readonly expected = false\n ) {\n super(message);\n this.name = 'EmailDeliveryError';\n }\n}\n\nexport async function sendEmail(\n data: {\n to: string;\n subject: string;\n text: string;\n html: string;\n replyTo?: string;\n },\n options: {\n fetch?: (\n input: string | URL | Request,\n init?: RequestInit\n ) => Promise<Response>;\n postmarkToken?: string;\n }\n) {\n if (!options.postmarkToken) {\n throw new EmailDeliveryError('Postmark is not configured');\n }\n\n const response = await (options.fetch ?? fetch)(\n 'https://api.postmarkapp.com/email',\n {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-Postmark-Server-Token': options.postmarkToken,\n },\n body: JSON.stringify({\n From: 'VRPlatform <notifications@vrplatform.app>',\n To: data.to,\n Subject: data.subject,\n ReplyTo: data.replyTo,\n TextBody: data.text,\n HtmlBody: data.html,\n MessageStream: 'outbound',\n }),\n }\n );\n\n const providerResponse: unknown = await response.json().catch(() => ({}));\n const providerMessage =\n providerResponse !== null &&\n typeof providerResponse === 'object' &&\n 'Message' in providerResponse &&\n typeof providerResponse.Message === 'string'\n ? providerResponse.Message\n : undefined;\n\n if (!response.ok) {\n if (\n response.status === 422 &&\n providerMessage?.includes('marked as inactive')\n ) {\n throw new EmailDeliveryError(\n 'Postmark recipient is inactive',\n {\n providerMessage,\n status: response.status,\n statusText: response.statusText,\n },\n true\n );\n }\n\n throw new EmailDeliveryError('Postmark rejected the email', {\n providerResponse,\n status: response.status,\n statusText: response.statusText,\n });\n }\n\n return { status: response.status };\n}\n"]}
1
+ {"version":3,"file":"send-email.js","sourceRoot":"src/","sources":["utils/send-email.ts"],"names":[],"mappings":";;;AA4BA,8BAmIC;AAED,sDAkEC;AAnOD,6CAAwC;AAgBxC,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YACE,OAAe,EACC,OAAmC,EACnC,WAAW,KAAK,EAChB,YAAY,IAAI;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,YAAO,GAAP,OAAO,CAA4B;QACnC,aAAQ,GAAR,QAAQ,CAAQ;QAChB,cAAS,GAAT,SAAS,CAAO;QAGhC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAVD,gDAUC;AAEM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AAkB,CAC1B,4BAA4B,EAC5B,OAAO,EACP,KAAK,EACL,KAAK,CACN,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,kBAAkB,CAC1B,6BAA6B,EAC7B,OAAO,EACP,KAAK,EACL,uBAAuB,CAAC,SAAS,CAClC,CAAC;IACJ,CAAC;IACD,IAAI,WAAW,IAAI,kBAAkB,YAAY,kBAAkB,EAAE,CAAC;QACpE,MAAM,IAAI,kBAAkB,CAC1B,gCAAgC,EAChC,OAAO,EACP,IAAI,EACJ,KAAK,CACN,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,kBAAkB,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC","sourcesContent":["import { day } from '@vrplatform/utils';\n\ntype EmailDeliveryFailureDetails = {\n httpStatus: number;\n postmarkErrorCode?: number;\n provider: 'postmark';\n providerCategory: 'inactiveRecipient' | 'rejected';\n};\n\ntype EmailDeliveryErrorDetails =\n | EmailDeliveryFailureDetails\n | {\n failureCount: number;\n failures: EmailDeliveryFailureDetails[];\n };\n\nexport class EmailDeliveryError extends Error {\n constructor(\n message: string,\n public readonly details?: EmailDeliveryErrorDetails,\n public readonly expected = false,\n public readonly retryable = true\n ) {\n super(message);\n this.name = 'EmailDeliveryError';\n }\n}\n\nexport async function sendEmail(\n data: {\n to: string;\n subject: string;\n text: string;\n html: string;\n replyTo?: string;\n tag?: string;\n metadata?: Record<string, string>;\n },\n options: {\n fetch?: (\n input: string | URL | Request,\n init?: RequestInit\n ) => Promise<Response>;\n postmarkToken?: string;\n }\n) {\n if (!options.postmarkToken) {\n throw new EmailDeliveryError(\n 'Postmark is not configured',\n undefined,\n false,\n false\n );\n }\n\n const response = await (options.fetch ?? fetch)(\n 'https://api.postmarkapp.com/email',\n {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-Postmark-Server-Token': options.postmarkToken,\n },\n body: JSON.stringify({\n From: 'VRPlatform <notifications@vrplatform.app>',\n To: data.to,\n Subject: data.subject,\n ReplyTo: data.replyTo,\n TextBody: data.text,\n HtmlBody: data.html,\n MessageStream: 'outbound',\n Tag: data.tag,\n Metadata: data.metadata,\n }),\n }\n );\n\n const providerResponse: unknown = await response.json().catch(() => ({}));\n const responseErrorCode =\n providerResponse !== null &&\n typeof providerResponse === 'object' &&\n 'ErrorCode' in providerResponse &&\n typeof providerResponse.ErrorCode === 'number'\n ? providerResponse.ErrorCode\n : undefined;\n const headerErrorCode = response.headers.get('X-PM-ApiErrorCode');\n const errorCode =\n responseErrorCode ??\n (headerErrorCode && /^\\d+$/.test(headerErrorCode)\n ? Number(headerErrorCode)\n : undefined);\n const postmarkErrorCode =\n typeof errorCode === 'number' &&\n Number.isSafeInteger(errorCode) &&\n errorCode >= 0\n ? errorCode\n : undefined;\n\n if (\n !response.ok ||\n (postmarkErrorCode !== undefined && postmarkErrorCode !== 0)\n ) {\n const inactiveRecipient =\n response.status === 422 && postmarkErrorCode === 406;\n const details: EmailDeliveryFailureDetails = {\n provider: 'postmark',\n providerCategory: inactiveRecipient ? 'inactiveRecipient' : 'rejected',\n httpStatus: response.status,\n ...(postmarkErrorCode !== undefined ? { postmarkErrorCode } : {}),\n };\n\n if (inactiveRecipient) {\n throw new EmailDeliveryError(\n 'Postmark recipient is inactive',\n details,\n true,\n false\n );\n }\n\n throw new EmailDeliveryError(\n 'Postmark rejected the email',\n details,\n false,\n response.status === 429 || response.status >= 500\n );\n }\n\n const messageId =\n providerResponse !== null &&\n typeof providerResponse === 'object' &&\n 'MessageID' in providerResponse &&\n typeof providerResponse.MessageID === 'string' &&\n providerResponse.MessageID\n ? providerResponse.MessageID\n : undefined;\n const submittedAt =\n providerResponse !== null &&\n typeof providerResponse === 'object' &&\n 'SubmittedAt' in providerResponse &&\n typeof providerResponse.SubmittedAt === 'string' &&\n day(providerResponse.SubmittedAt).isValid()\n ? providerResponse.SubmittedAt\n : undefined;\n if (!messageId || !submittedAt || postmarkErrorCode !== 0) {\n throw new EmailDeliveryError('Postmark returned an invalid response', {\n provider: 'postmark',\n providerCategory: 'rejected',\n httpStatus: response.status,\n ...(postmarkErrorCode !== undefined ? { postmarkErrorCode } : {}),\n });\n }\n\n return {\n httpStatus: response.status,\n messageId,\n submittedAt,\n };\n}\n\nexport async function settleEmailDeliveries(deliveries: Promise<unknown>[]) {\n const failures = (await Promise.allSettled(deliveries)).filter(\n (result) => result.status === 'rejected'\n );\n if (failures.length === 0) return;\n\n const unexpectedDeliveryError = failures.find(\n (failure) =>\n failure.reason instanceof EmailDeliveryError && !failure.reason.expected\n )?.reason;\n const allExpected = failures.every(\n (failure) =>\n failure.reason instanceof EmailDeliveryError && failure.reason.expected\n );\n const firstDeliveryError = failures.find(\n (failure) => failure.reason instanceof EmailDeliveryError\n )?.reason;\n const failureDetails = failures.flatMap((failure) => {\n if (\n !(failure.reason instanceof EmailDeliveryError) ||\n !failure.reason.details ||\n !('provider' in failure.reason.details)\n ) {\n return [];\n }\n const { httpStatus, postmarkErrorCode, provider, providerCategory } =\n failure.reason.details;\n return [\n {\n httpStatus,\n provider,\n providerCategory,\n ...(postmarkErrorCode !== undefined ? { postmarkErrorCode } : {}),\n },\n ];\n });\n\n const details: EmailDeliveryErrorDetails = {\n failureCount: failures.length,\n failures: failureDetails,\n };\n if (unexpectedDeliveryError instanceof EmailDeliveryError) {\n if (unexpectedDeliveryError.message === 'Postmark is not configured') {\n throw new EmailDeliveryError(\n 'Postmark is not configured',\n details,\n false,\n false\n );\n }\n throw new EmailDeliveryError(\n 'Postmark rejected the email',\n details,\n false,\n unexpectedDeliveryError.retryable\n );\n }\n if (allExpected && firstDeliveryError instanceof EmailDeliveryError) {\n throw new EmailDeliveryError(\n 'Postmark recipient is inactive',\n details,\n true,\n false\n );\n }\n throw new EmailDeliveryError('Email delivery failed', details);\n}\n"]}
@@ -46,7 +46,7 @@ const Footer = () => (_jsxs(_Fragment, { children: [_jsx(Hr, { style: {
46
46
  marginBottom: '50px',
47
47
  } }), _jsxs(Text, { style: {
48
48
  color: '#737373',
49
- }, children: ["\u00A9 ", day().year(), " VRPlatform Ventures Ltd. All rights reserved."] }), _jsx(Text, { style: {
49
+ }, children: ["\u00A9 ", day().year(), " VR Technologies. All rights reserved."] }), _jsx(Text, { style: {
50
50
  color: '#737373',
51
51
  }, children: "VR Technologies, LLC, a company incorporated and registered in the United States of America with company number 20201965158" })] }));
52
52
  const VrpLogo = () => (_jsxs("svg", { width: "100%", height: "100%", viewBox: "0 0 28 29", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M18.2549 8.25161C18.2549 5.89704 20.1636 3.98828 22.5182 3.98828C24.8728 3.98828 26.7815 5.89704 26.7815 8.25161C26.7815 10.6062 24.8728 12.5149 22.5182 12.5149C20.1636 12.5149 18.2549 10.6062 18.2549 8.25161Z", fill: "#172554" }), _jsx("path", { d: "M7.02441 8.46593C7.02441 6.01867 9.20858 3.99805 11.6558 3.99805C14.1031 3.99805 15.0558 5.59785 16.5612 7.52728C17.1957 8.34054 20.7921 13.3413 20.7921 13.3413C20.7921 13.3413 21.566 14.6863 21.566 15.7894C21.566 18.5287 17.1993 22.8381 17.1993 22.8381L7.66841 10.6799C7.66841 10.6799 7.02441 10.0502 7.02441 8.46593Z", fill: "#172554", fillOpacity: "0.8" }), _jsx("path", { d: "M1.24707 8.42687C1.24707 5.97961 3.43123 3.95898 5.8785 3.95898C8.32576 3.95898 9.27845 5.55879 10.7839 7.48824C11.4184 8.30147 14.6041 12.4888 16.8247 15.5727C18.3585 17.703 18.474 17.705 18.474 20.3439C18.474 22.9827 15.1592 24.1379 14.1483 24.1914C12.0203 24.304 10.5418 22.4681 10.5418 22.4681L1.89106 10.6408C1.89106 10.6408 1.24707 10.0111 1.24707 8.42687Z", fill: "#172554" })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"EmailContainer.js","sourceRoot":"src/","sources":["components/EmailContainer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,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AC,CACnB,8BACE,KAAC,EAAE,IACD,KAAK,EAAE;gBACL,SAAS,EAAE,MAAM;gBACjB,YAAY,EAAE,MAAM;aACrB,GACD,EAEF,MAAC,IAAI,IACH,KAAK,EAAE;gBACL,KAAK,EAAE,SAAS;aACjB,wBAEE,GAAG,EAAE,CAAC,IAAI,EAAE,sDACV,EACP,KAAC,IAAI,IACH,KAAK,EAAE;gBACL,KAAK,EAAE,SAAS;aACjB,4IAII,IACN,CACJ,CAAC;AAEF,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CACpB,eACE,KAAK,EAAC,MAAM,EACZ,MAAM,EAAC,MAAM,EACb,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,aAElC,eACE,CAAC,EAAC,mNAAmN,EACrN,IAAI,EAAC,SAAS,GACd,EACF,eACE,CAAC,EAAC,gUAAgU,EAClU,IAAI,EAAC,SAAS,EACd,WAAW,EAAC,KAAK,GACjB,EACF,eACE,CAAC,EAAC,4WAA4W,EAC9W,IAAI,EAAC,SAAS,GACd,IACE,CACP,CAAC","sourcesContent":["import { Body } from '@react-email/body';\nimport { Font } from '@react-email/font';\nimport { Head } from '@react-email/head';\nimport { Hr } from '@react-email/hr';\nimport { Html } from '@react-email/html';\nimport { Img } from '@react-email/img';\nimport { Preview } from '@react-email/preview';\nimport { Text } from '@react-email/text';\nimport { day } from '@vrplatform/utils';\nimport type { EmailBaseProps } from '../types';\n\ntype Props = {\n children: React.ReactNode;\n title: string;\n tenant: Omit<EmailBaseProps['tenant'], 'name'>;\n mode: EmailBaseProps['mode'];\n shortDescription?: string;\n};\n\nexport const EmailContainer = (props: Props) => {\n const { children, shortDescription, title } = props;\n\n const contentWrapperStyle = {\n paddingInline: '20px',\n paddingBlock: '10px',\n maxWidth: '500px',\n margin: '0 auto',\n };\n\n if (props.mode !== 'send') {\n return (\n <div style={contentWrapperStyle}>\n <Content {...props}>{children}</Content>\n </div>\n );\n }\n\n return (\n <Html lang=\"en\">\n <Head>\n <title>{title}</title>\n <Font\n fontFamily=\"Inter\"\n fallbackFontFamily=\"Verdana\"\n webFont={{\n url: 'https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7W0Q5nw.woff2',\n format: 'woff2',\n }}\n fontWeight={400}\n fontStyle=\"normal\"\n />\n <Font\n fontFamily=\"Inter\"\n fallbackFontFamily=\"Verdana\"\n webFont={{\n url: 'https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7W0Q5nw.woff2',\n format: 'woff2',\n }}\n fontWeight={600}\n fontStyle=\"normal\"\n />\n </Head>\n {shortDescription && <Preview>{shortDescription}</Preview>}\n <Body style={contentWrapperStyle}>\n <Content {...props}>{children}</Content>\n </Body>\n </Html>\n );\n};\n\nconst Content = ({ children, tenant: { logo: tenantLogo }, mode }: Props) => {\n return (\n <>\n {tenantLogo ? (\n <div\n style={{\n marginBottom: '60px',\n padding: '5px',\n // border: '1px solid rgb(233,236,239)',\n borderRadius: '5px',\n width: '80px',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Img src={tenantLogo} alt={'Logo'} width={70} />\n </div>\n ) : mode === 'send' ? (\n <Img\n src={'https://staging.portal.vrplatform.app/logo.png'}\n alt={'Logo'}\n width={70}\n style={{ marginBottom: '60px' }}\n />\n ) : (\n <div\n style={{\n width: '60px',\n }}\n >\n <VrpLogo />\n </div>\n )}\n\n {children}\n\n <Footer />\n </>\n );\n};\n\nconst Footer = () => (\n <>\n <Hr\n style={{\n marginTop: '30px',\n marginBottom: '50px',\n }}\n />\n\n <Text\n style={{\n color: '#737373',\n }}\n >\n © {day().year()} VRPlatform Ventures Ltd. All rights reserved.\n </Text>\n <Text\n style={{\n color: '#737373',\n }}\n >\n VR Technologies, LLC, a company incorporated and registered in the United\n States of America with company number 20201965158\n </Text>\n </>\n);\n\nconst VrpLogo = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 28 29\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M18.2549 8.25161C18.2549 5.89704 20.1636 3.98828 22.5182 3.98828C24.8728 3.98828 26.7815 5.89704 26.7815 8.25161C26.7815 10.6062 24.8728 12.5149 22.5182 12.5149C20.1636 12.5149 18.2549 10.6062 18.2549 8.25161Z\"\n fill=\"#172554\"\n />\n <path\n d=\"M7.02441 8.46593C7.02441 6.01867 9.20858 3.99805 11.6558 3.99805C14.1031 3.99805 15.0558 5.59785 16.5612 7.52728C17.1957 8.34054 20.7921 13.3413 20.7921 13.3413C20.7921 13.3413 21.566 14.6863 21.566 15.7894C21.566 18.5287 17.1993 22.8381 17.1993 22.8381L7.66841 10.6799C7.66841 10.6799 7.02441 10.0502 7.02441 8.46593Z\"\n fill=\"#172554\"\n fillOpacity=\"0.8\"\n />\n <path\n d=\"M1.24707 8.42687C1.24707 5.97961 3.43123 3.95898 5.8785 3.95898C8.32576 3.95898 9.27845 5.55879 10.7839 7.48824C11.4184 8.30147 14.6041 12.4888 16.8247 15.5727C18.3585 17.703 18.474 17.705 18.474 20.3439C18.474 22.9827 15.1592 24.1379 14.1483 24.1914C12.0203 24.304 10.5418 22.4681 10.5418 22.4681L1.89106 10.6408C1.89106 10.6408 1.24707 10.0111 1.24707 8.42687Z\"\n fill=\"#172554\"\n />\n </svg>\n);\n"]}
1
+ {"version":3,"file":"EmailContainer.js","sourceRoot":"src/","sources":["components/EmailContainer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO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AAC,IAAI,IACH,KAAK,EAAE;gBACL,KAAK,EAAE,SAAS;aACjB,4IAII,IACN,CACJ,CAAC;AAEF,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CACpB,eACE,KAAK,EAAC,MAAM,EACZ,MAAM,EAAC,MAAM,EACb,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,aAElC,eACE,CAAC,EAAC,mNAAmN,EACrN,IAAI,EAAC,SAAS,GACd,EACF,eACE,CAAC,EAAC,gUAAgU,EAClU,IAAI,EAAC,SAAS,EACd,WAAW,EAAC,KAAK,GACjB,EACF,eACE,CAAC,EAAC,4WAA4W,EAC9W,IAAI,EAAC,SAAS,GACd,IACE,CACP,CAAC","sourcesContent":["import { Body } from '@react-email/body';\nimport { Font } from '@react-email/font';\nimport { Head } from '@react-email/head';\nimport { Hr } from '@react-email/hr';\nimport { Html } from '@react-email/html';\nimport { Img } from '@react-email/img';\nimport { Preview } from '@react-email/preview';\nimport { Text } from '@react-email/text';\nimport { day } from '@vrplatform/utils';\nimport type { EmailBaseProps } from '../types';\n\ntype Props = {\n children: React.ReactNode;\n title: string;\n tenant: Omit<EmailBaseProps['tenant'], 'name'>;\n mode: EmailBaseProps['mode'];\n shortDescription?: string;\n};\n\nexport const EmailContainer = (props: Props) => {\n const { children, shortDescription, title } = props;\n\n const contentWrapperStyle = {\n paddingInline: '20px',\n paddingBlock: '10px',\n maxWidth: '500px',\n margin: '0 auto',\n };\n\n if (props.mode !== 'send') {\n return (\n <div style={contentWrapperStyle}>\n <Content {...props}>{children}</Content>\n </div>\n );\n }\n\n return (\n <Html lang=\"en\">\n <Head>\n <title>{title}</title>\n <Font\n fontFamily=\"Inter\"\n fallbackFontFamily=\"Verdana\"\n webFont={{\n url: 'https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7W0Q5nw.woff2',\n format: 'woff2',\n }}\n fontWeight={400}\n fontStyle=\"normal\"\n />\n <Font\n fontFamily=\"Inter\"\n fallbackFontFamily=\"Verdana\"\n webFont={{\n url: 'https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7W0Q5nw.woff2',\n format: 'woff2',\n }}\n fontWeight={600}\n fontStyle=\"normal\"\n />\n </Head>\n {shortDescription && <Preview>{shortDescription}</Preview>}\n <Body style={contentWrapperStyle}>\n <Content {...props}>{children}</Content>\n </Body>\n </Html>\n );\n};\n\nconst Content = ({ children, tenant: { logo: tenantLogo }, mode }: Props) => {\n return (\n <>\n {tenantLogo ? (\n <div\n style={{\n marginBottom: '60px',\n padding: '5px',\n // border: '1px solid rgb(233,236,239)',\n borderRadius: '5px',\n width: '80px',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Img src={tenantLogo} alt={'Logo'} width={70} />\n </div>\n ) : mode === 'send' ? (\n <Img\n src={'https://staging.portal.vrplatform.app/logo.png'}\n alt={'Logo'}\n width={70}\n style={{ marginBottom: '60px' }}\n />\n ) : (\n <div\n style={{\n width: '60px',\n }}\n >\n <VrpLogo />\n </div>\n )}\n\n {children}\n\n <Footer />\n </>\n );\n};\n\nconst Footer = () => (\n <>\n <Hr\n style={{\n marginTop: '30px',\n marginBottom: '50px',\n }}\n />\n\n <Text\n style={{\n color: '#737373',\n }}\n >\n © {day().year()} VR Technologies. All rights reserved.\n </Text>\n <Text\n style={{\n color: '#737373',\n }}\n >\n VR Technologies, LLC, a company incorporated and registered in the United\n States of America with company number 20201965158\n </Text>\n </>\n);\n\nconst VrpLogo = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 28 29\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M18.2549 8.25161C18.2549 5.89704 20.1636 3.98828 22.5182 3.98828C24.8728 3.98828 26.7815 5.89704 26.7815 8.25161C26.7815 10.6062 24.8728 12.5149 22.5182 12.5149C20.1636 12.5149 18.2549 10.6062 18.2549 8.25161Z\"\n fill=\"#172554\"\n />\n <path\n d=\"M7.02441 8.46593C7.02441 6.01867 9.20858 3.99805 11.6558 3.99805C14.1031 3.99805 15.0558 5.59785 16.5612 7.52728C17.1957 8.34054 20.7921 13.3413 20.7921 13.3413C20.7921 13.3413 21.566 14.6863 21.566 15.7894C21.566 18.5287 17.1993 22.8381 17.1993 22.8381L7.66841 10.6799C7.66841 10.6799 7.02441 10.0502 7.02441 8.46593Z\"\n fill=\"#172554\"\n fillOpacity=\"0.8\"\n />\n <path\n d=\"M1.24707 8.42687C1.24707 5.97961 3.43123 3.95898 5.8785 3.95898C8.32576 3.95898 9.27845 5.55879 10.7839 7.48824C11.4184 8.30147 14.6041 12.4888 16.8247 15.5727C18.3585 17.703 18.474 17.705 18.474 20.3439C18.474 22.9827 15.1592 24.1379 14.1483 24.1914C12.0203 24.304 10.5418 22.4681 10.5418 22.4681L1.89106 10.6408C1.89106 10.6408 1.24707 10.0111 1.24707 8.42687Z\"\n fill=\"#172554\"\n />\n </svg>\n);\n"]}
@@ -3,4 +3,6 @@ export declare const getDefaultInviteOwnerEmailData: (mode: "tag" | "text", args
3
3
  appName: string;
4
4
  signInLink: string;
5
5
  }) => ActionEmailData;
6
- export declare const InviteOwnerEmailTemplate: (props: ActionEmailTemplateProps) => import("react").JSX.Element;
6
+ export declare const InviteOwnerEmailTemplate: ({ ownerAccessRole, ...props }: ActionEmailTemplateProps & {
7
+ ownerAccessRole?: "admin" | "viewer";
8
+ }) => import("react").JSX.Element;
@@ -4,16 +4,20 @@ import { ActionEmailTemplate, } from '../components';
4
4
  export const getDefaultInviteOwnerEmailData = (mode, args) => {
5
5
  const signInLink = mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.signInLink;
6
6
  return {
7
- bodyOne: `<p>You are invited to join us on ${args.appName}.</p><p>To start using ${args.appName}, accept the invitation and verify your email address.</p>`,
7
+ bodyOne: `<p>You are invited to access your Owner Portal on ${args.appName}.</p><p>Accept the invitation below to set up your access.</p>`,
8
8
  bodyTwo: `<p>If you have any trouble with the button, you can copy and paste the link below into your browser: ${signInLink}</p>`,
9
9
  buttonText: 'Accept Invitation',
10
- header: 'Welcome to the team!',
11
- shortDescription: 'You have been invited to join the team. To start using VRPlatform, verify your email address at link below.',
10
+ header: 'Welcome to your Owner Portal!',
11
+ shortDescription: 'Set up your Owner Portal access using your invitation.',
12
12
  href: args.signInLink,
13
- subject: `You are invited to join your team on ${args.appName}`,
13
+ subject: `Your invitation to the ${args.appName} Owner Portal`,
14
14
  };
15
15
  };
16
- export const InviteOwnerEmailTemplate = (props) => {
17
- return _jsx(ActionEmailTemplate, { ...props });
16
+ export const InviteOwnerEmailTemplate = ({ ownerAccessRole = 'admin', ...props }) => {
17
+ return (_jsx(ActionEmailTemplate, { ...props, data: {
18
+ ...props.data,
19
+ // Add guidance at render time so saved custom templates receive it too.
20
+ bodyTwo: `${props.data.bodyTwo}<hr style="width:100%;border:none;border-top:1px solid #eaeaea;margin:24px 0" /><p>This invitation link is for one-time setup of your Owner Portal access and expires after 7 days. Sign up using the exact email address this invitation was sent to.</p><p>If your invitation expires before setup is complete, contact your property manager for a new invitation.</p><p>For questions about ${ownerAccessRole === 'viewer' ? 'portal access' : 'your statements or portal access'}, contact your property manager.</p>`,
21
+ } }));
18
22
  };
19
23
  //# sourceMappingURL=InviteOwnerEmailTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InviteOwnerEmailTemplate.js","sourceRoot":"src/","sources":["templates/InviteOwnerEmailTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAEL,mBAAmB,GAEpB,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC5C,IAAoB,EACpB,IAGC,EACgB,EAAE;IACnB,MAAM,UAAU,GACd,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;IAEjE,OAAO;QACL,OAAO,EAAE,oCAAoC,IAAI,CAAC,OAAO,0BAA0B,IAAI,CAAC,OAAO,4DAA4D;QAC3J,OAAO,EAAE,wGAAwG,UAAU,MAAM;QACjI,UAAU,EAAE,mBAAmB;QAC/B,MAAM,EAAE,sBAAsB;QAC9B,gBAAgB,EACd,6GAA6G;QAC/G,IAAI,EAAE,IAAI,CAAC,UAAU;QACrB,OAAO,EAAE,wCAAwC,IAAI,CAAC,OAAO,EAAE;KAChE,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAA+B,EAAE,EAAE;IAC1E,OAAO,KAAC,mBAAmB,OAAK,KAAK,GAAI,CAAC;AAC5C,CAAC,CAAC","sourcesContent":["import { EMAIL_ACTION_LINK_COMPONENT } from '../extensions';\nimport {\n type ActionEmailData,\n ActionEmailTemplate,\n type ActionEmailTemplateProps,\n} from '../components';\n\nexport const getDefaultInviteOwnerEmailData = (\n mode: 'tag' | 'text',\n args: {\n appName: string;\n signInLink: string;\n }\n): ActionEmailData => {\n const signInLink =\n mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.signInLink;\n\n return {\n bodyOne: `<p>You are invited to join us on ${args.appName}.</p><p>To start using ${args.appName}, accept the invitation and verify your email address.</p>`,\n bodyTwo: `<p>If you have any trouble with the button, you can copy and paste the link below into your browser: ${signInLink}</p>`,\n buttonText: 'Accept Invitation',\n header: 'Welcome to the team!',\n shortDescription:\n 'You have been invited to join the team. To start using VRPlatform, verify your email address at link below.',\n href: args.signInLink,\n subject: `You are invited to join your team on ${args.appName}`,\n };\n};\n\nexport const InviteOwnerEmailTemplate = (props: ActionEmailTemplateProps) => {\n return <ActionEmailTemplate {...props} />;\n};\n"]}
1
+ {"version":3,"file":"InviteOwnerEmailTemplate.js","sourceRoot":"src/","sources":["templates/InviteOwnerEmailTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAEL,mBAAmB,GAEpB,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC5C,IAAoB,EACpB,IAGC,EACgB,EAAE;IACnB,MAAM,UAAU,GACd,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;IAEjE,OAAO;QACL,OAAO,EAAE,qDAAqD,IAAI,CAAC,OAAO,gEAAgE;QAC1I,OAAO,EAAE,wGAAwG,UAAU,MAAM;QACjI,UAAU,EAAE,mBAAmB;QAC/B,MAAM,EAAE,+BAA+B;QACvC,gBAAgB,EAAE,wDAAwD;QAC1E,IAAI,EAAE,IAAI,CAAC,UAAU;QACrB,OAAO,EAAE,0BAA0B,IAAI,CAAC,OAAO,eAAe;KAC/D,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EACvC,eAAe,GAAG,OAAO,EACzB,GAAG,KAAK,EAGT,EAAE,EAAE;IACH,OAAO,CACL,KAAC,mBAAmB,OACd,KAAK,EACT,IAAI,EAAE;YACJ,GAAG,KAAK,CAAC,IAAI;YACb,wEAAwE;YACxE,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,mYAAmY,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,kCAAkC,sCAAsC;SAC3hB,GACD,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { EMAIL_ACTION_LINK_COMPONENT } from '../extensions';\nimport {\n type ActionEmailData,\n ActionEmailTemplate,\n type ActionEmailTemplateProps,\n} from '../components';\n\nexport const getDefaultInviteOwnerEmailData = (\n mode: 'tag' | 'text',\n args: {\n appName: string;\n signInLink: string;\n }\n): ActionEmailData => {\n const signInLink =\n mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.signInLink;\n\n return {\n bodyOne: `<p>You are invited to access your Owner Portal on ${args.appName}.</p><p>Accept the invitation below to set up your access.</p>`,\n bodyTwo: `<p>If you have any trouble with the button, you can copy and paste the link below into your browser: ${signInLink}</p>`,\n buttonText: 'Accept Invitation',\n header: 'Welcome to your Owner Portal!',\n shortDescription: 'Set up your Owner Portal access using your invitation.',\n href: args.signInLink,\n subject: `Your invitation to the ${args.appName} Owner Portal`,\n };\n};\n\nexport const InviteOwnerEmailTemplate = ({\n ownerAccessRole = 'admin',\n ...props\n}: ActionEmailTemplateProps & {\n ownerAccessRole?: 'admin' | 'viewer';\n}) => {\n return (\n <ActionEmailTemplate\n {...props}\n data={{\n ...props.data,\n // Add guidance at render time so saved custom templates receive it too.\n bodyTwo: `${props.data.bodyTwo}<hr style=\"width:100%;border:none;border-top:1px solid #eaeaea;margin:24px 0\" /><p>This invitation link is for one-time setup of your Owner Portal access and expires after 7 days. Sign up using the exact email address this invitation was sent to.</p><p>If your invitation expires before setup is complete, contact your property manager for a new invitation.</p><p>For questions about ${ownerAccessRole === 'viewer' ? 'portal access' : 'your statements or portal access'}, contact your property manager.</p>`,\n }}\n />\n );\n};\n"]}