@deenruv/email-plugin 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -0
- package/README.md +85 -0
- package/dev-mailbox.html +218 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +30 -0
- package/lib/index.js.map +1 -0
- package/lib/src/attachment-utils.d.ts +3 -0
- package/lib/src/attachment-utils.js +66 -0
- package/lib/src/attachment-utils.js.map +1 -0
- package/lib/src/common.d.ts +4 -0
- package/lib/src/common.js +17 -0
- package/lib/src/common.js.map +1 -0
- package/lib/src/constants.d.ts +2 -0
- package/lib/src/constants.js +6 -0
- package/lib/src/constants.js.map +1 -0
- package/lib/src/dev-mailbox.d.ts +14 -0
- package/lib/src/dev-mailbox.js +116 -0
- package/lib/src/dev-mailbox.js.map +1 -0
- package/lib/src/email-processor.d.ts +21 -0
- package/lib/src/email-processor.js +109 -0
- package/lib/src/email-processor.js.map +1 -0
- package/lib/src/email-send-event.d.ts +18 -0
- package/lib/src/email-send-event.js +24 -0
- package/lib/src/email-send-event.js.map +1 -0
- package/lib/src/event-listener.d.ts +19 -0
- package/lib/src/event-listener.js +25 -0
- package/lib/src/event-listener.js.map +1 -0
- package/lib/src/generator/email-generator.d.ts +25 -0
- package/lib/src/generator/email-generator.js +3 -0
- package/lib/src/generator/email-generator.js.map +1 -0
- package/lib/src/generator/handlebars-mjml-generator.d.ts +19 -0
- package/lib/src/generator/handlebars-mjml-generator.js +78 -0
- package/lib/src/generator/handlebars-mjml-generator.js.map +1 -0
- package/lib/src/generator/noop-email-generator.d.ts +11 -0
- package/lib/src/generator/noop-email-generator.js +13 -0
- package/lib/src/generator/noop-email-generator.js.map +1 -0
- package/lib/src/generator/react-email-generator.d.ts +7 -0
- package/lib/src/generator/react-email-generator.js +40 -0
- package/lib/src/generator/react-email-generator.js.map +1 -0
- package/lib/src/handler/default-email-handlers.d.ts +32 -0
- package/lib/src/handler/default-email-handlers.js +111 -0
- package/lib/src/handler/default-email-handlers.js.map +1 -0
- package/lib/src/handler/event-handler.d.ts +276 -0
- package/lib/src/handler/event-handler.js +396 -0
- package/lib/src/handler/event-handler.js.map +1 -0
- package/lib/src/handler/mock-events.d.ts +5 -0
- package/lib/src/handler/mock-events.js +119 -0
- package/lib/src/handler/mock-events.js.map +1 -0
- package/lib/src/plugin.d.ts +301 -0
- package/lib/src/plugin.js +428 -0
- package/lib/src/plugin.js.map +1 -0
- package/lib/src/sender/email-sender.d.ts +45 -0
- package/lib/src/sender/email-sender.js +3 -0
- package/lib/src/sender/email-sender.js.map +1 -0
- package/lib/src/sender/nodemailer-email-sender.d.ts +37 -0
- package/lib/src/sender/nodemailer-email-sender.js +151 -0
- package/lib/src/sender/nodemailer-email-sender.js.map +1 -0
- package/lib/src/template-loader/file-based-template-loader.d.ts +17 -0
- package/lib/src/template-loader/file-based-template-loader.js +37 -0
- package/lib/src/template-loader/file-based-template-loader.js.map +1 -0
- package/lib/src/template-loader/react-email-template-loader.d.ts +6 -0
- package/lib/src/template-loader/react-email-template-loader.js +14 -0
- package/lib/src/template-loader/react-email-template-loader.js.map +1 -0
- package/lib/src/template-loader/template-loader.d.ts +42 -0
- package/lib/src/template-loader/template-loader.js +3 -0
- package/lib/src/template-loader/template-loader.js.map +1 -0
- package/lib/src/types.d.ts +453 -0
- package/lib/src/types.js +3 -0
- package/lib/src/types.js.map +1 -0
- package/package.json +51 -0
- package/templates/email-address-change/body.hbs +20 -0
- package/templates/email-verification/body.hbs +20 -0
- package/templates/order-confirmation/body.hbs +133 -0
- package/templates/partials/footer.hbs +10 -0
- package/templates/partials/header.hbs +18 -0
- package/templates/password-reset/body.hbs +24 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{{> header title="Verify Your Email Address" }}
|
|
2
|
+
|
|
3
|
+
<mj-section background-color="#fafafa">
|
|
4
|
+
<mj-column>
|
|
5
|
+
<mj-text color="#525252">
|
|
6
|
+
Thank you for creating an account. Click the button below to verify this email address and
|
|
7
|
+
complete the registration process:
|
|
8
|
+
</mj-text>
|
|
9
|
+
|
|
10
|
+
<mj-button font-family="Helvetica"
|
|
11
|
+
background-color="#f45e43"
|
|
12
|
+
color="white"
|
|
13
|
+
href="{{ verifyEmailAddressUrl }}?token={{ verificationToken }}">
|
|
14
|
+
Verify Me!
|
|
15
|
+
</mj-button>
|
|
16
|
+
</mj-column>
|
|
17
|
+
</mj-section>
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
{{> footer }}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
{{> header title="Order Receipt" }}
|
|
2
|
+
|
|
3
|
+
<mj-raw>
|
|
4
|
+
<style type="text/css">
|
|
5
|
+
.callout {
|
|
6
|
+
background-color: #375a67;
|
|
7
|
+
padding: 15px 0;
|
|
8
|
+
}
|
|
9
|
+
.callout-large > div {
|
|
10
|
+
text-align: center !important;
|
|
11
|
+
color: #fff !important;
|
|
12
|
+
font-size: 16px !important;
|
|
13
|
+
font-weight: bold;
|
|
14
|
+
padding: 0;
|
|
15
|
+
}
|
|
16
|
+
.callout-small > div {
|
|
17
|
+
text-align: center !important;
|
|
18
|
+
color: #fff !important;
|
|
19
|
+
font-size: 14px !important;
|
|
20
|
+
padding: 0;
|
|
21
|
+
}
|
|
22
|
+
ul.address {
|
|
23
|
+
list-style-type: none;
|
|
24
|
+
padding: 0;
|
|
25
|
+
}
|
|
26
|
+
tr.order-row td {
|
|
27
|
+
border-bottom: 1px dashed #eee;
|
|
28
|
+
}
|
|
29
|
+
tr.order-row td:last-child {
|
|
30
|
+
text-align: center;
|
|
31
|
+
}
|
|
32
|
+
tr.total-row {
|
|
33
|
+
font-weight: bold;
|
|
34
|
+
}
|
|
35
|
+
.bg-off-white {
|
|
36
|
+
background-color: #f5f5f5;
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
39
|
+
</mj-raw>
|
|
40
|
+
|
|
41
|
+
<mj-section css-class="bg-off-white">
|
|
42
|
+
<mj-column>
|
|
43
|
+
<mj-text>
|
|
44
|
+
Dear {{ order.customer.firstName }} {{ order.customer.lastName }},
|
|
45
|
+
</mj-text>
|
|
46
|
+
<mj-text>
|
|
47
|
+
Thank you for your order!
|
|
48
|
+
</mj-text>
|
|
49
|
+
</mj-column>
|
|
50
|
+
</mj-section>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
<mj-section css-class="callout">
|
|
54
|
+
<mj-column>
|
|
55
|
+
<mj-text css-class="callout-large"><strong>Order Code</strong></mj-text>
|
|
56
|
+
<mj-text css-class="callout-small">{{ order.code }}</mj-text>
|
|
57
|
+
</mj-column>
|
|
58
|
+
<mj-column>
|
|
59
|
+
<mj-text css-class="callout-large"><strong>Order Date</strong></mj-text>
|
|
60
|
+
<mj-text css-class="callout-small">{{ formatDate order.orderPlacedAt }}</mj-text>
|
|
61
|
+
</mj-column>
|
|
62
|
+
<mj-column>
|
|
63
|
+
<mj-text css-class="callout-large"><strong>Total Price</strong></mj-text>
|
|
64
|
+
<mj-text css-class="callout-small">{{ formatMoney order.total order.currencyCode 'en' }}</mj-text>
|
|
65
|
+
</mj-column>
|
|
66
|
+
</mj-section>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
<mj-section css-class="bg-off-white">
|
|
70
|
+
<mj-column>
|
|
71
|
+
<mj-text>
|
|
72
|
+
{{#with order.shippingAddress }}
|
|
73
|
+
<h3>Shipping To: {{ fullName }}</h3>
|
|
74
|
+
<ul class="address">
|
|
75
|
+
{{#if company}}<li>{{ company }}</li>{{/if}}
|
|
76
|
+
{{#if streetLine1}}<li>{{ streetLine1 }}</li>{{/if}}
|
|
77
|
+
{{#if streetLine2}}<li>{{ streetLine2 }}</li>{{/if}}
|
|
78
|
+
{{#if city}}<li>{{ city }}</li>{{/if}}
|
|
79
|
+
{{#if province}}<li>{{ province }}</li>{{/if}}
|
|
80
|
+
{{#if postalCode}}<li>{{ postalCode }}</li>{{/if}}
|
|
81
|
+
{{#if country}}<li>{{ country }}</li>{{/if}}
|
|
82
|
+
{{#if phoneNumber}}<li>{{ phoneNumber }}</li>{{/if}}
|
|
83
|
+
</ul>
|
|
84
|
+
{{/with}}
|
|
85
|
+
</mj-text>
|
|
86
|
+
</mj-column>
|
|
87
|
+
</mj-section>
|
|
88
|
+
|
|
89
|
+
<mj-section>
|
|
90
|
+
<mj-column>
|
|
91
|
+
<mj-text>
|
|
92
|
+
<h3>Order Summary:</h3>
|
|
93
|
+
</mj-text>
|
|
94
|
+
<mj-table cellpadding="6px">
|
|
95
|
+
{{#each order.lines }}
|
|
96
|
+
<tr class="order-row">
|
|
97
|
+
<td>
|
|
98
|
+
<img alt="{{ productVariant.name }}"
|
|
99
|
+
style="width: 50px; height: 50px;"
|
|
100
|
+
src="{{ featuredAsset.preview }}?w=50&h=50" />
|
|
101
|
+
</td>
|
|
102
|
+
<td>{{ quantity }} x {{ productVariant.name }}</td>
|
|
103
|
+
<td>{{ productVariant.quantity }}</td>
|
|
104
|
+
<td>{{ formatMoney discountedLinePriceWithTax ../order.currencyCode 'en' }}</td>
|
|
105
|
+
</tr>
|
|
106
|
+
{{/each}}
|
|
107
|
+
{{#each order.discounts }}
|
|
108
|
+
<tr class="order-row">
|
|
109
|
+
<td colspan="3">
|
|
110
|
+
{{ description }}
|
|
111
|
+
</td>
|
|
112
|
+
<td>{{ formatMoney amount ../order.currencyCode 'en' }}</td>
|
|
113
|
+
</tr>
|
|
114
|
+
{{/each}}
|
|
115
|
+
<tr class="order-row">
|
|
116
|
+
<td colspan="3">Sub-total:</td>
|
|
117
|
+
<td>{{ formatMoney order.subTotalWithTax order.currencyCode 'en' }}</td>
|
|
118
|
+
</tr>
|
|
119
|
+
{{#each shippingLines }}
|
|
120
|
+
<tr class="order-row">
|
|
121
|
+
<td colspan="3">Shipping ({{ shippingMethod.name }}):</td>
|
|
122
|
+
<td>{{ formatMoney priceWithTax ../order.currencyCode 'en' }}</td>
|
|
123
|
+
</tr>
|
|
124
|
+
{{/each}}
|
|
125
|
+
<tr class="order-row total-row">
|
|
126
|
+
<td colspan="3">Total:</td>
|
|
127
|
+
<td>{{ formatMoney order.totalWithTax order.currencyCode 'en' }}</td>
|
|
128
|
+
</tr>
|
|
129
|
+
</mj-table>
|
|
130
|
+
</mj-column>
|
|
131
|
+
</mj-section>
|
|
132
|
+
|
|
133
|
+
{{> footer }}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<mjml>
|
|
2
|
+
<mj-head>
|
|
3
|
+
<mj-title>{{ title }}</mj-title>
|
|
4
|
+
<mj-style inline="inline">
|
|
5
|
+
h3 {
|
|
6
|
+
font-size: 18px;
|
|
7
|
+
color: #555;
|
|
8
|
+
font-weight: normal;
|
|
9
|
+
}
|
|
10
|
+
</mj-style>
|
|
11
|
+
</mj-head>
|
|
12
|
+
|
|
13
|
+
<mj-body>
|
|
14
|
+
<mj-section background-color="#f0f0f0">
|
|
15
|
+
<mj-column>
|
|
16
|
+
<mj-text>[company header]</mj-text>
|
|
17
|
+
</mj-column>
|
|
18
|
+
</mj-section>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{{> header title="Forgotten password reset" }}
|
|
2
|
+
|
|
3
|
+
<mj-section background-color="#fafafa">
|
|
4
|
+
<mj-column>
|
|
5
|
+
<mj-text color="#525252">
|
|
6
|
+
Someone requested a new password for your account.
|
|
7
|
+
</mj-text>
|
|
8
|
+
|
|
9
|
+
<mj-button font-family="Helvetica"
|
|
10
|
+
background-color="#f45e43"
|
|
11
|
+
color="white"
|
|
12
|
+
href="{{ passwordResetUrl }}?token={{ passwordResetToken }}">
|
|
13
|
+
Reset password
|
|
14
|
+
</mj-button>
|
|
15
|
+
|
|
16
|
+
<mj-text color="#525252">
|
|
17
|
+
If you didn't make this request then you can safely ignore this email - nothing has been changed on your account.
|
|
18
|
+
</mj-text>
|
|
19
|
+
|
|
20
|
+
</mj-column>
|
|
21
|
+
</mj-section>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
{{> footer }}
|