@vrplatform/email 1.0.0 → 1.0.2-stage.6229
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/components/ActionEmailTemplate.d.ts +1 -1
- package/build/main/components/ActionEmailTemplate.js +18 -14
- package/build/main/components/ActionEmailTemplate.js.map +1 -1
- package/build/main/components/Button.d.ts +1 -1
- package/build/main/components/Button.js +7 -3
- package/build/main/components/Button.js.map +1 -1
- package/build/main/components/EmailContainer.d.ts +1 -1
- package/build/main/components/EmailContainer.js +26 -21
- package/build/main/components/EmailContainer.js.map +1 -1
- package/build/main/components/index.js +18 -2
- package/build/main/components/index.js.map +1 -1
- package/build/main/components/utils/index.js +17 -1
- package/build/main/components/utils/index.js.map +1 -1
- package/build/main/components/utils/parse-email-html.js +9 -5
- package/build/main/components/utils/parse-email-html.js.map +1 -1
- package/build/main/const.js +4 -1
- package/build/main/const.js.map +1 -1
- package/build/main/extensions.js +7 -4
- package/build/main/extensions.js.map +1 -1
- package/build/main/index.js +25 -6
- package/build/main/index.js.map +1 -1
- package/build/main/templates/InviteOwnerEmailTemplate.d.ts +1 -3
- package/build/main/templates/InviteOwnerEmailTemplate.js +12 -29
- package/build/main/templates/InviteOwnerEmailTemplate.js.map +1 -1
- package/build/main/templates/InvitePmEmailTemplate.d.ts +1 -3
- package/build/main/templates/InvitePmEmailTemplate.js +12 -34
- package/build/main/templates/InvitePmEmailTemplate.js.map +1 -1
- package/build/main/templates/OwnerStatementEmailTemplate.d.ts +1 -3
- package/build/main/templates/OwnerStatementEmailTemplate.js +15 -43
- package/build/main/templates/OwnerStatementEmailTemplate.js.map +1 -1
- package/build/main/templates/TenantDeletionEmailTemplate.d.ts +2 -4
- package/build/main/templates/TenantDeletionEmailTemplate.js +15 -19
- package/build/main/templates/TenantDeletionEmailTemplate.js.map +1 -1
- package/build/main/templates/TenantSuspensionEmailTemplate.d.ts +1 -3
- package/build/main/templates/TenantSuspensionEmailTemplate.js +13 -17
- package/build/main/templates/TenantSuspensionEmailTemplate.js.map +1 -1
- package/build/main/templates/index.d.ts +0 -2
- package/build/main/templates/index.js +21 -8
- package/build/main/templates/index.js.map +1 -1
- package/build/main/theme.d.ts +1 -1
- package/build/main/theme.js +7 -3
- package/build/main/theme.js.map +1 -1
- package/build/main/types.js +2 -1
- package/build/main/types.js.map +1 -1
- package/build/main/utils/index.js +17 -1
- package/build/main/utils/index.js.map +1 -1
- package/build/main/utils/send-email.d.ts +17 -10
- package/build/main/utils/send-email.js +41 -6
- package/build/main/utils/send-email.js.map +1 -1
- package/build/module/components/ActionEmailTemplate.d.ts +1 -1
- package/build/module/components/ActionEmailTemplate.js.map +1 -1
- package/build/module/components/Button.d.ts +1 -1
- package/build/module/components/Button.js.map +1 -1
- package/build/module/components/EmailContainer.d.ts +1 -1
- package/build/module/components/EmailContainer.js +2 -1
- package/build/module/components/EmailContainer.js.map +1 -1
- package/build/module/components/index.js.map +1 -1
- package/build/module/components/utils/index.js.map +1 -1
- package/build/module/components/utils/parse-email-html.js +4 -4
- package/build/module/components/utils/parse-email-html.js.map +1 -1
- package/build/module/const.js.map +1 -1
- package/build/module/extensions.js.map +1 -1
- package/build/module/index.js.map +1 -1
- package/build/module/templates/InviteOwnerEmailTemplate.d.ts +1 -3
- package/build/module/templates/InviteOwnerEmailTemplate.js +0 -22
- package/build/module/templates/InviteOwnerEmailTemplate.js.map +1 -1
- package/build/module/templates/InvitePmEmailTemplate.d.ts +1 -3
- package/build/module/templates/InvitePmEmailTemplate.js +0 -27
- package/build/module/templates/InvitePmEmailTemplate.js.map +1 -1
- package/build/module/templates/OwnerStatementEmailTemplate.d.ts +1 -3
- package/build/module/templates/OwnerStatementEmailTemplate.js +0 -33
- package/build/module/templates/OwnerStatementEmailTemplate.js.map +1 -1
- package/build/module/templates/TenantDeletionEmailTemplate.d.ts +2 -4
- package/build/module/templates/TenantDeletionEmailTemplate.js +0 -9
- package/build/module/templates/TenantDeletionEmailTemplate.js.map +1 -1
- package/build/module/templates/TenantSuspensionEmailTemplate.d.ts +1 -3
- package/build/module/templates/TenantSuspensionEmailTemplate.js +0 -8
- package/build/module/templates/TenantSuspensionEmailTemplate.js.map +1 -1
- package/build/module/templates/index.d.ts +0 -2
- package/build/module/templates/index.js +0 -3
- package/build/module/templates/index.js.map +1 -1
- package/build/module/theme.d.ts +1 -1
- package/build/module/theme.js.map +1 -1
- package/build/module/types.js.map +1 -1
- package/build/module/utils/index.js.map +1 -1
- package/build/module/utils/send-email.d.ts +17 -10
- package/build/module/utils/send-email.js +38 -6
- package/build/module/utils/send-email.js.map +1 -1
- package/package.json +31 -31
- package/src/components/EmailContainer.tsx +2 -1
- package/src/components/utils/parse-email-html.ts +4 -7
- package/src/templates/InviteOwnerEmailTemplate.tsx +0 -34
- package/src/templates/InvitePmEmailTemplate.tsx +0 -41
- package/src/templates/OwnerStatementEmailTemplate.tsx +0 -47
- package/src/templates/TenantDeletionEmailTemplate.tsx +0 -17
- package/src/templates/TenantSuspensionEmailTemplate.tsx +0 -16
- package/src/templates/index.ts +0 -4
- package/src/theme.ts +1 -1
- package/src/utils/send-email.ts +76 -27
- package/build/main/components/utils/parse-email-html.test.d.ts +0 -1
- package/build/main/components/utils/parse-email-html.test.js +0 -59
- package/build/main/components/utils/parse-email-html.test.js.map +0 -1
- package/build/main/templates/OwnerStatementSummaryEmailTemplate.d.ts +0 -9
- package/build/main/templates/OwnerStatementSummaryEmailTemplate.js +0 -46
- package/build/main/templates/OwnerStatementSummaryEmailTemplate.js.map +0 -1
- package/build/main/templates/OwnerTaxStatementEmailTemplate.d.ts +0 -10
- package/build/main/templates/OwnerTaxStatementEmailTemplate.js +0 -47
- package/build/main/templates/OwnerTaxStatementEmailTemplate.js.map +0 -1
- package/build/main/tsconfig.main.tsbuildinfo +0 -1
- package/build/module/components/utils/parse-email-html.test.d.ts +0 -1
- package/build/module/components/utils/parse-email-html.test.js +0 -59
- package/build/module/components/utils/parse-email-html.test.js.map +0 -1
- package/build/module/templates/OwnerStatementSummaryEmailTemplate.d.ts +0 -9
- package/build/module/templates/OwnerStatementSummaryEmailTemplate.js +0 -46
- package/build/module/templates/OwnerStatementSummaryEmailTemplate.js.map +0 -1
- package/build/module/templates/OwnerTaxStatementEmailTemplate.d.ts +0 -10
- package/build/module/templates/OwnerTaxStatementEmailTemplate.js +0 -47
- package/build/module/templates/OwnerTaxStatementEmailTemplate.js.map +0 -1
- package/build/module/tsconfig.esm.tsbuildinfo +0 -1
- package/src/components/utils/parse-email-html.test.ts +0 -65
- package/src/templates/OwnerStatementSummaryEmailTemplate.tsx +0 -78
- package/src/templates/OwnerTaxStatementEmailTemplate.tsx +0 -80
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ActionEmailTemplate, } from '../components';
|
|
3
|
-
import { EMAIL_ACTION_LINK_COMPONENT, EMAIL_USER_NAME_COMPONENT, } from '../extensions';
|
|
4
|
-
export const getDefaultOwnerStatementSummaryEmailData = (mode, args) => {
|
|
5
|
-
const ownerStatementHref = mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.ownerStatementHref;
|
|
6
|
-
const userName = mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.userName;
|
|
7
|
-
return {
|
|
8
|
-
subject: 'Summary statement is ready',
|
|
9
|
-
shortDescription: `An summary statement is ready for you. Log in to ${args.appName} to view it.`,
|
|
10
|
-
header: 'Summary is ready to view',
|
|
11
|
-
bodyOne: `<p>Hi ${userName},<p>A summary statement is ready for your review on ${args.appName}.</p><p>To access your statement, please click the button below:</p>`,
|
|
12
|
-
buttonText: 'View statement',
|
|
13
|
-
bodyTwo: `<p>If you have any trouble with the button, you can copy and paste the link below into your browser: ${ownerStatementHref}</p>`,
|
|
14
|
-
href: args.ownerStatementHref,
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export const OwnerStatementSummaryEmailTemplate = (props) => {
|
|
18
|
-
return _jsx(ActionEmailTemplate, { ...props });
|
|
19
|
-
};
|
|
20
|
-
const Preview = () => {
|
|
21
|
-
const defaultName = 'John';
|
|
22
|
-
return (_jsx(ActionEmailTemplate, { mode: "send", tenant: {
|
|
23
|
-
name: 'Pineapple Mountain',
|
|
24
|
-
logo: 'https://imagedelivery.net/Ftdv9WftbW1DctaiLSVfFA/fbd8c31f-478f-4eb0-74ac-c8eeb47b5000/256x256',
|
|
25
|
-
}, data: getDefaultOwnerStatementSummaryEmailData('text', {
|
|
26
|
-
appName: 'VRPlatform',
|
|
27
|
-
ownerStatementHref: 'https://example.com',
|
|
28
|
-
userName: defaultName,
|
|
29
|
-
}), user: {
|
|
30
|
-
firstName: 'John',
|
|
31
|
-
}, listing: undefined, month: undefined, themeColors: [
|
|
32
|
-
// portal.brown
|
|
33
|
-
'#9E9390',
|
|
34
|
-
'#8D7C78',
|
|
35
|
-
'#7C6964',
|
|
36
|
-
'#6E5954',
|
|
37
|
-
'#614B46',
|
|
38
|
-
'#573F39',
|
|
39
|
-
'#4E342E',
|
|
40
|
-
'#3F2D29',
|
|
41
|
-
'#332725',
|
|
42
|
-
'#2A2220',
|
|
43
|
-
] }));
|
|
44
|
-
};
|
|
45
|
-
export default Preview;
|
|
46
|
-
//# sourceMappingURL=OwnerStatementSummaryEmailTemplate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OwnerStatementSummaryEmailTemplate.js","sourceRoot":"src/","sources":["templates/OwnerStatementSummaryEmailTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,mBAAmB,GAEpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,wCAAwC,GAAG,CACtD,IAAoB,EACpB,IAIC,EACgB,EAAE;IACnB,MAAM,kBAAkB,GACtB,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,IAAI,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 -1,10 +0,0 @@
|
|
|
1
|
-
import { type ActionEmailData, type ActionEmailTemplateProps } from '../components';
|
|
2
|
-
export declare const getDefaultOwnerTaxStatementEmailData: (mode: "tag" | "text", args: {
|
|
3
|
-
appName: string;
|
|
4
|
-
href: string;
|
|
5
|
-
firstName: string | undefined | null;
|
|
6
|
-
year: number;
|
|
7
|
-
}) => ActionEmailData;
|
|
8
|
-
export declare const OwnerTaxStatementEmailTemplate: (props: ActionEmailTemplateProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
declare const Preview: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export default Preview;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { EMAIL_ACTION_LINK_COMPONENT, EMAIL_USER_NAME_COMPONENT, } from '../extensions';
|
|
3
|
-
import { ActionEmailTemplate, } from '../components';
|
|
4
|
-
export const getDefaultOwnerTaxStatementEmailData = (mode, args) => {
|
|
5
|
-
const href = mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.href;
|
|
6
|
-
const firstName = mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.firstName || 'there';
|
|
7
|
-
return {
|
|
8
|
-
subject: 'Your 1099 Tax Statement is ready',
|
|
9
|
-
shortDescription: `Your 1099 Tax Statement is ready for you. Log in to ${args.appName} to view it.`,
|
|
10
|
-
header: '1099 Tax Statement is ready',
|
|
11
|
-
bodyOne: `<p>Hi ${firstName},<p>Your 1099 tax statement for ${args.year} is now available for you to review on ${args.appName}.</p><p>Click below to see your tax statement before we send it to the IRS.</p><p>To update your tax statement details, log into your ${args.appName} account and navigate to Settings>Statement Details.</p><p>To view your annual summary statement, navigate to the Summary page from within your ${args.appName} account.</p><p>Simply reply to this email if you have any questions.</p>`,
|
|
12
|
-
buttonText: 'View tax statement',
|
|
13
|
-
bodyTwo: `<p>If you have any trouble with the button, you can copy and paste the link below into your browser: ${href}</p>`,
|
|
14
|
-
href: args.href,
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export const OwnerTaxStatementEmailTemplate = (props) => {
|
|
18
|
-
return _jsx(ActionEmailTemplate, { ...props });
|
|
19
|
-
};
|
|
20
|
-
const Preview = () => {
|
|
21
|
-
const defaultName = 'John';
|
|
22
|
-
return (_jsx(ActionEmailTemplate, { mode: "send", tenant: {
|
|
23
|
-
name: 'Pineapple Mountain',
|
|
24
|
-
logo: 'https://imagedelivery.net/Ftdv9WftbW1DctaiLSVfFA/fbd8c31f-478f-4eb0-74ac-c8eeb47b5000/256x256',
|
|
25
|
-
}, data: getDefaultOwnerTaxStatementEmailData('text', {
|
|
26
|
-
appName: 'VRPlatform',
|
|
27
|
-
href: 'https://example.com',
|
|
28
|
-
firstName: defaultName,
|
|
29
|
-
year: new Date().getFullYear(),
|
|
30
|
-
}), user: {
|
|
31
|
-
firstName: 'John',
|
|
32
|
-
}, listing: undefined, month: undefined, themeColors: [
|
|
33
|
-
// portal.brown
|
|
34
|
-
'#9E9390',
|
|
35
|
-
'#8D7C78',
|
|
36
|
-
'#7C6964',
|
|
37
|
-
'#6E5954',
|
|
38
|
-
'#614B46',
|
|
39
|
-
'#573F39',
|
|
40
|
-
'#4E342E',
|
|
41
|
-
'#3F2D29',
|
|
42
|
-
'#332725',
|
|
43
|
-
'#2A2220',
|
|
44
|
-
] }));
|
|
45
|
-
};
|
|
46
|
-
export default Preview;
|
|
47
|
-
//# sourceMappingURL=OwnerTaxStatementEmailTemplate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OwnerTaxStatementEmailTemplate.js","sourceRoot":"src/","sources":["templates/OwnerTaxStatementEmailTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,mBAAmB,GAEpB,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,oCAAoC,GAAG,CACl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SAClB,EACD,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE;YACX,eAAe;YACf,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;SACV,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"root":["../../src/const.ts","../../src/extensions.ts","../../src/index.ts","../../src/theme.ts","../../src/types.ts","../../src/components/actionemailtemplate.tsx","../../src/components/button.tsx","../../src/components/emailcontainer.tsx","../../src/components/index.ts","../../src/components/utils/index.ts","../../src/components/utils/parse-email-html.test.ts","../../src/components/utils/parse-email-html.ts","../../src/templates/inviteowneremailtemplate.tsx","../../src/templates/invitepmemailtemplate.tsx","../../src/templates/ownerstatementemailtemplate.tsx","../../src/templates/ownerstatementsummaryemailtemplate.tsx","../../src/templates/ownertaxstatementemailtemplate.tsx","../../src/templates/tenantdeletionemailtemplate.tsx","../../src/templates/tenantsuspensionemailtemplate.tsx","../../src/templates/index.ts","../../src/utils/index.ts","../../src/utils/send-email.ts"],"version":"5.8.3"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test';
|
|
2
|
-
import { parseEmailHtml } from './parse-email-html';
|
|
3
|
-
|
|
4
|
-
describe('parseEmailHtml', () => {
|
|
5
|
-
it('should replace <action-link-component></action-link-component> with the sign-in link anchor tag', () => {
|
|
6
|
-
const html = '<div><action-link-component></action-link-component></div>';
|
|
7
|
-
const args: Parameters<typeof parseEmailHtml>[1] = {
|
|
8
|
-
href: 'https://example.com/signin',
|
|
9
|
-
userName: 'John Doe',
|
|
10
|
-
date: '2023-01-01',
|
|
11
|
-
listingName: '123 Main St',
|
|
12
|
-
};
|
|
13
|
-
const result = parseEmailHtml(html, args);
|
|
14
|
-
expect(result).toBe(
|
|
15
|
-
'<div><a href="https://example.com/signin" target="_blank">https://example.com/signin</a></div>'
|
|
16
|
-
);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should replace <user-name-component></user-name-component> with the user name', () => {
|
|
20
|
-
const html =
|
|
21
|
-
'<div>Hello <user-name-component></user-name-component>!</div>';
|
|
22
|
-
const args: Parameters<typeof parseEmailHtml>[1] = {
|
|
23
|
-
href: 'https://example.com/signin',
|
|
24
|
-
userName: 'John Doe',
|
|
25
|
-
date: '2023-01-01',
|
|
26
|
-
listingName: '123 Main St',
|
|
27
|
-
};
|
|
28
|
-
const result = parseEmailHtml(html, args);
|
|
29
|
-
expect(result).toBe('<div>Hello John Doe!</div>');
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('should replace both <action-link-component> and <user-name-component> appropriately', () => {
|
|
33
|
-
const html = `
|
|
34
|
-
<div>
|
|
35
|
-
<action-link-component></action-link-component>
|
|
36
|
-
<user-name-component></user-name-component>
|
|
37
|
-
</div>
|
|
38
|
-
`;
|
|
39
|
-
const args: Parameters<typeof parseEmailHtml>[1] = {
|
|
40
|
-
href: 'https://example.com/signin',
|
|
41
|
-
userName: 'Jane Doe',
|
|
42
|
-
date: '2023-01-01',
|
|
43
|
-
listingName: '123 Main St',
|
|
44
|
-
};
|
|
45
|
-
const result = parseEmailHtml(html, args);
|
|
46
|
-
expect(result).toBe(`
|
|
47
|
-
<div>
|
|
48
|
-
<a href="https://example.com/signin" target="_blank">https://example.com/signin</a>
|
|
49
|
-
Jane Doe
|
|
50
|
-
</div>
|
|
51
|
-
`);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('should return the input HTML unchanged if there are no components to replace', () => {
|
|
55
|
-
const html = '<div>No components to replace here</div>';
|
|
56
|
-
const args: Parameters<typeof parseEmailHtml>[1] = {
|
|
57
|
-
href: 'https://example.com/signin',
|
|
58
|
-
userName: 'John Doe',
|
|
59
|
-
date: '2023-01-01',
|
|
60
|
-
listingName: '123 Main St',
|
|
61
|
-
};
|
|
62
|
-
const result = parseEmailHtml(html, args);
|
|
63
|
-
expect(result).toBe('<div>No components to replace here</div>');
|
|
64
|
-
});
|
|
65
|
-
});
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ActionEmailData,
|
|
3
|
-
ActionEmailTemplate,
|
|
4
|
-
type ActionEmailTemplateProps,
|
|
5
|
-
} from '../components';
|
|
6
|
-
import {
|
|
7
|
-
EMAIL_ACTION_LINK_COMPONENT,
|
|
8
|
-
EMAIL_USER_NAME_COMPONENT,
|
|
9
|
-
} from '../extensions';
|
|
10
|
-
|
|
11
|
-
export const getDefaultOwnerStatementSummaryEmailData = (
|
|
12
|
-
mode: 'tag' | 'text',
|
|
13
|
-
args: {
|
|
14
|
-
appName: string;
|
|
15
|
-
ownerStatementHref: string;
|
|
16
|
-
userName: string;
|
|
17
|
-
}
|
|
18
|
-
): ActionEmailData => {
|
|
19
|
-
const ownerStatementHref =
|
|
20
|
-
mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.ownerStatementHref;
|
|
21
|
-
|
|
22
|
-
const userName = mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.userName;
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
subject: 'Summary statement is ready',
|
|
26
|
-
shortDescription: `An summary statement is ready for you. Log in to ${args.appName} to view it.`,
|
|
27
|
-
header: 'Summary is ready to view',
|
|
28
|
-
bodyOne: `<p>Hi ${userName},<p>A summary statement is ready for your review on ${args.appName}.</p><p>To access your statement, please click the button below:</p>`,
|
|
29
|
-
buttonText: 'View statement',
|
|
30
|
-
bodyTwo: `<p>If you have any trouble with the button, you can copy and paste the link below into your browser: ${ownerStatementHref}</p>`,
|
|
31
|
-
href: args.ownerStatementHref,
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const OwnerStatementSummaryEmailTemplate = (
|
|
36
|
-
props: ActionEmailTemplateProps
|
|
37
|
-
) => {
|
|
38
|
-
return <ActionEmailTemplate {...props} />;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const Preview = () => {
|
|
42
|
-
const defaultName = 'John';
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<ActionEmailTemplate
|
|
46
|
-
mode="send"
|
|
47
|
-
tenant={{
|
|
48
|
-
name: 'Pineapple Mountain',
|
|
49
|
-
logo: 'https://imagedelivery.net/Ftdv9WftbW1DctaiLSVfFA/fbd8c31f-478f-4eb0-74ac-c8eeb47b5000/256x256',
|
|
50
|
-
}}
|
|
51
|
-
data={getDefaultOwnerStatementSummaryEmailData('text', {
|
|
52
|
-
appName: 'VRPlatform',
|
|
53
|
-
ownerStatementHref: 'https://example.com',
|
|
54
|
-
userName: defaultName,
|
|
55
|
-
})}
|
|
56
|
-
user={{
|
|
57
|
-
firstName: 'John',
|
|
58
|
-
}}
|
|
59
|
-
listing={undefined}
|
|
60
|
-
month={undefined}
|
|
61
|
-
themeColors={[
|
|
62
|
-
// portal.brown
|
|
63
|
-
'#9E9390',
|
|
64
|
-
'#8D7C78',
|
|
65
|
-
'#7C6964',
|
|
66
|
-
'#6E5954',
|
|
67
|
-
'#614B46',
|
|
68
|
-
'#573F39',
|
|
69
|
-
'#4E342E',
|
|
70
|
-
'#3F2D29',
|
|
71
|
-
'#332725',
|
|
72
|
-
'#2A2220',
|
|
73
|
-
]}
|
|
74
|
-
/>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export default Preview;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EMAIL_ACTION_LINK_COMPONENT,
|
|
3
|
-
EMAIL_USER_NAME_COMPONENT,
|
|
4
|
-
} from '../extensions';
|
|
5
|
-
import {
|
|
6
|
-
type ActionEmailData,
|
|
7
|
-
ActionEmailTemplate,
|
|
8
|
-
type ActionEmailTemplateProps,
|
|
9
|
-
} from '../components';
|
|
10
|
-
|
|
11
|
-
export const getDefaultOwnerTaxStatementEmailData = (
|
|
12
|
-
mode: 'tag' | 'text',
|
|
13
|
-
args: {
|
|
14
|
-
appName: string;
|
|
15
|
-
href: string;
|
|
16
|
-
firstName: string | undefined | null;
|
|
17
|
-
year: number;
|
|
18
|
-
}
|
|
19
|
-
): ActionEmailData => {
|
|
20
|
-
const href = mode === 'tag' ? EMAIL_ACTION_LINK_COMPONENT : args.href;
|
|
21
|
-
|
|
22
|
-
const firstName =
|
|
23
|
-
mode === 'tag' ? EMAIL_USER_NAME_COMPONENT : args.firstName || 'there';
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
subject: 'Your 1099 Tax Statement is ready',
|
|
27
|
-
shortDescription: `Your 1099 Tax Statement is ready for you. Log in to ${args.appName} to view it.`,
|
|
28
|
-
header: '1099 Tax Statement is ready',
|
|
29
|
-
bodyOne: `<p>Hi ${firstName},<p>Your 1099 tax statement for ${args.year} is now available for you to review on ${args.appName}.</p><p>Click below to see your tax statement before we send it to the IRS.</p><p>To update your tax statement details, log into your ${args.appName} account and navigate to Settings>Statement Details.</p><p>To view your annual summary statement, navigate to the Summary page from within your ${args.appName} account.</p><p>Simply reply to this email if you have any questions.</p>`,
|
|
30
|
-
buttonText: 'View tax statement',
|
|
31
|
-
bodyTwo: `<p>If you have any trouble with the button, you can copy and paste the link below into your browser: ${href}</p>`,
|
|
32
|
-
href: args.href,
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const OwnerTaxStatementEmailTemplate = (
|
|
37
|
-
props: ActionEmailTemplateProps
|
|
38
|
-
) => {
|
|
39
|
-
return <ActionEmailTemplate {...props} />;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const Preview = () => {
|
|
43
|
-
const defaultName = 'John';
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<ActionEmailTemplate
|
|
47
|
-
mode="send"
|
|
48
|
-
tenant={{
|
|
49
|
-
name: 'Pineapple Mountain',
|
|
50
|
-
logo: 'https://imagedelivery.net/Ftdv9WftbW1DctaiLSVfFA/fbd8c31f-478f-4eb0-74ac-c8eeb47b5000/256x256',
|
|
51
|
-
}}
|
|
52
|
-
data={getDefaultOwnerTaxStatementEmailData('text', {
|
|
53
|
-
appName: 'VRPlatform',
|
|
54
|
-
href: 'https://example.com',
|
|
55
|
-
firstName: defaultName,
|
|
56
|
-
year: new Date().getFullYear(),
|
|
57
|
-
})}
|
|
58
|
-
user={{
|
|
59
|
-
firstName: 'John',
|
|
60
|
-
}}
|
|
61
|
-
listing={undefined}
|
|
62
|
-
month={undefined}
|
|
63
|
-
themeColors={[
|
|
64
|
-
// portal.brown
|
|
65
|
-
'#9E9390',
|
|
66
|
-
'#8D7C78',
|
|
67
|
-
'#7C6964',
|
|
68
|
-
'#6E5954',
|
|
69
|
-
'#614B46',
|
|
70
|
-
'#573F39',
|
|
71
|
-
'#4E342E',
|
|
72
|
-
'#3F2D29',
|
|
73
|
-
'#332725',
|
|
74
|
-
'#2A2220',
|
|
75
|
-
]}
|
|
76
|
-
/>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export default Preview;
|