@vendure/email-plugin 2.1.0-next.4 → 2.1.0-next.5
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.
|
@@ -7,7 +7,7 @@ import { EmailDetails, EmailTransportOptions } from './types';
|
|
|
7
7
|
* {@link NodemailerEmailSender}, but it is also possible to supply a custom implementation:
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
-
* ```
|
|
10
|
+
* ```ts
|
|
11
11
|
* const sgMail = require('\@sendgrid/mail');
|
|
12
12
|
*
|
|
13
13
|
* sgMail.setApiKey(process.env.SENDGRID_API_KEY);
|
|
@@ -56,7 +56,7 @@ import { EmailTemplateConfig, EventWithAsyncData, EventWithContext, Intermediate
|
|
|
56
56
|
*
|
|
57
57
|
* ### 1. Create a new handler
|
|
58
58
|
*
|
|
59
|
-
* ```
|
|
59
|
+
* ```ts
|
|
60
60
|
* import { EmailEventListener } from `\@vendure/email-plugin`;
|
|
61
61
|
* import { QuoteRequestedEvent } from `./events`;
|
|
62
62
|
*
|
|
@@ -96,7 +96,7 @@ import { EmailTemplateConfig, EventWithAsyncData, EventWithContext, Intermediate
|
|
|
96
96
|
*
|
|
97
97
|
* Finally, you need to register the handler with the EmailPlugin:
|
|
98
98
|
*
|
|
99
|
-
* ```
|
|
99
|
+
* ```ts {hl_lines=[8]}
|
|
100
100
|
* import { defaultEmailHandlers, EmailPlugin } from '\@vendure/email-plugin';
|
|
101
101
|
* import { quoteRequestedHandler } from './plugins/quote-plugin';
|
|
102
102
|
*
|
|
@@ -191,7 +191,7 @@ export declare class EmailEventHandler<T extends string = string, Event extends
|
|
|
191
191
|
* errors may result if using the DefaultJobQueuePlugin with certain DBs such as MySQL/MariaDB.
|
|
192
192
|
*
|
|
193
193
|
* @example
|
|
194
|
-
* ```
|
|
194
|
+
* ```ts
|
|
195
195
|
* const testAttachmentHandler = new EmailEventListener('activate-voucher')
|
|
196
196
|
* .on(ActivateVoucherEvent)
|
|
197
197
|
* // ... omitted some steps for brevity
|
|
@@ -225,7 +225,7 @@ export declare class EmailEventHandler<T extends string = string, Event extends
|
|
|
225
225
|
* added to the `event` as the `data` property.
|
|
226
226
|
*
|
|
227
227
|
* @example
|
|
228
|
-
* ```
|
|
228
|
+
* ```ts
|
|
229
229
|
* new EmailEventListener('order-confirmation')
|
|
230
230
|
* .on(OrderStateTransitionEvent)
|
|
231
231
|
* .filter(event => event.toState === 'PaymentSettled' && !!event.order.customer)
|
package/lib/src/event-handler.js
CHANGED
|
@@ -57,7 +57,7 @@ const constants_1 = require("./constants");
|
|
|
57
57
|
*
|
|
58
58
|
* ### 1. Create a new handler
|
|
59
59
|
*
|
|
60
|
-
* ```
|
|
60
|
+
* ```ts
|
|
61
61
|
* import { EmailEventListener } from `\@vendure/email-plugin`;
|
|
62
62
|
* import { QuoteRequestedEvent } from `./events`;
|
|
63
63
|
*
|
|
@@ -97,7 +97,7 @@ const constants_1 = require("./constants");
|
|
|
97
97
|
*
|
|
98
98
|
* Finally, you need to register the handler with the EmailPlugin:
|
|
99
99
|
*
|
|
100
|
-
* ```
|
|
100
|
+
* ```ts {hl_lines=[8]}
|
|
101
101
|
* import { defaultEmailHandlers, EmailPlugin } from '\@vendure/email-plugin';
|
|
102
102
|
* import { quoteRequestedHandler } from './plugins/quote-plugin';
|
|
103
103
|
*
|
|
@@ -209,7 +209,7 @@ class EmailEventHandler {
|
|
|
209
209
|
* errors may result if using the DefaultJobQueuePlugin with certain DBs such as MySQL/MariaDB.
|
|
210
210
|
*
|
|
211
211
|
* @example
|
|
212
|
-
* ```
|
|
212
|
+
* ```ts
|
|
213
213
|
* const testAttachmentHandler = new EmailEventListener('activate-voucher')
|
|
214
214
|
* .on(ActivateVoucherEvent)
|
|
215
215
|
* // ... omitted some steps for brevity
|
|
@@ -249,7 +249,7 @@ class EmailEventHandler {
|
|
|
249
249
|
* added to the `event` as the `data` property.
|
|
250
250
|
*
|
|
251
251
|
* @example
|
|
252
|
-
* ```
|
|
252
|
+
* ```ts
|
|
253
253
|
* new EmailEventListener('order-confirmation')
|
|
254
254
|
* .on(OrderStateTransitionEvent)
|
|
255
255
|
* .filter(event => event.toState === 'PaymentSettled' && !!event.order.customer)
|
package/lib/src/plugin.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ import { EmailPluginDevModeOptions, EmailPluginOptions, InitializedEmailPluginOp
|
|
|
106
106
|
*
|
|
107
107
|
* The `defaultEmailHandlers` array defines the default handlers such as for handling new account registration, order confirmation, password reset
|
|
108
108
|
* etc. These defaults can be extended by adding custom templates for languages other than the default, or even completely new types of emails
|
|
109
|
-
* which respond to any of the available [VendureEvents](/
|
|
109
|
+
* which respond to any of the available [VendureEvents](/reference/typescript-api/events/).
|
|
110
110
|
*
|
|
111
111
|
* A good way to learn how to create your own email handlers is to take a look at the
|
|
112
112
|
* [source code of the default handlers](https://github.com/vendure-ecommerce/vendure/blob/master/packages/email-plugin/src/default-email-handlers.ts).
|
|
@@ -114,7 +114,7 @@ import { EmailPluginDevModeOptions, EmailPluginOptions, InitializedEmailPluginOp
|
|
|
114
114
|
*
|
|
115
115
|
* It is also possible to modify the default handlers:
|
|
116
116
|
*
|
|
117
|
-
* ```
|
|
117
|
+
* ```ts
|
|
118
118
|
* // Rather than importing `defaultEmailHandlers`, you can
|
|
119
119
|
* // import the handlers individually
|
|
120
120
|
* import {
|
|
@@ -194,7 +194,7 @@ import { EmailPluginDevModeOptions, EmailPluginOptions, InitializedEmailPluginOp
|
|
|
194
194
|
* file transport (See {@link FileTransportOptions}) and outputs emails as rendered HTML files in the directory specified by the
|
|
195
195
|
* `outputPath` property.
|
|
196
196
|
*
|
|
197
|
-
* ```
|
|
197
|
+
* ```ts
|
|
198
198
|
* EmailPlugin.init({
|
|
199
199
|
* devMode: true,
|
|
200
200
|
* route: 'mailbox',
|
|
@@ -215,7 +215,7 @@ import { EmailPluginDevModeOptions, EmailPluginOptions, InitializedEmailPluginOp
|
|
|
215
215
|
* send detailed information from the SMTP transporter to the configured logger (defaults to console). For maximum detail combine
|
|
216
216
|
* this with a detail log level in the configured VendureLogger:
|
|
217
217
|
*
|
|
218
|
-
* ```
|
|
218
|
+
* ```ts
|
|
219
219
|
* const config: VendureConfig = {
|
|
220
220
|
* logger: new DefaultLogger({ level: LogLevel.Debug })
|
|
221
221
|
* // ...
|
package/lib/src/plugin.js
CHANGED
|
@@ -125,7 +125,7 @@ const template_loader_1 = require("./template-loader");
|
|
|
125
125
|
*
|
|
126
126
|
* The `defaultEmailHandlers` array defines the default handlers such as for handling new account registration, order confirmation, password reset
|
|
127
127
|
* etc. These defaults can be extended by adding custom templates for languages other than the default, or even completely new types of emails
|
|
128
|
-
* which respond to any of the available [VendureEvents](/
|
|
128
|
+
* which respond to any of the available [VendureEvents](/reference/typescript-api/events/).
|
|
129
129
|
*
|
|
130
130
|
* A good way to learn how to create your own email handlers is to take a look at the
|
|
131
131
|
* [source code of the default handlers](https://github.com/vendure-ecommerce/vendure/blob/master/packages/email-plugin/src/default-email-handlers.ts).
|
|
@@ -133,7 +133,7 @@ const template_loader_1 = require("./template-loader");
|
|
|
133
133
|
*
|
|
134
134
|
* It is also possible to modify the default handlers:
|
|
135
135
|
*
|
|
136
|
-
* ```
|
|
136
|
+
* ```ts
|
|
137
137
|
* // Rather than importing `defaultEmailHandlers`, you can
|
|
138
138
|
* // import the handlers individually
|
|
139
139
|
* import {
|
|
@@ -213,7 +213,7 @@ const template_loader_1 = require("./template-loader");
|
|
|
213
213
|
* file transport (See {@link FileTransportOptions}) and outputs emails as rendered HTML files in the directory specified by the
|
|
214
214
|
* `outputPath` property.
|
|
215
215
|
*
|
|
216
|
-
* ```
|
|
216
|
+
* ```ts
|
|
217
217
|
* EmailPlugin.init({
|
|
218
218
|
* devMode: true,
|
|
219
219
|
* route: 'mailbox',
|
|
@@ -234,7 +234,7 @@ const template_loader_1 = require("./template-loader");
|
|
|
234
234
|
* send detailed information from the SMTP transporter to the configured logger (defaults to console). For maximum detail combine
|
|
235
235
|
* this with a detail log level in the configured VendureLogger:
|
|
236
236
|
*
|
|
237
|
-
* ```
|
|
237
|
+
* ```ts
|
|
238
238
|
* const config: VendureConfig = {
|
|
239
239
|
* logger: new DefaultLogger({ level: LogLevel.Debug })
|
|
240
240
|
* // ...
|
package/lib/src/types.d.ts
CHANGED
|
@@ -150,7 +150,7 @@ export interface SMTPTransportOptions extends SMTPTransport.Options {
|
|
|
150
150
|
* See [Nodemailers's SES docs](https://nodemailer.com/transports/ses/) for more details
|
|
151
151
|
*
|
|
152
152
|
* @example
|
|
153
|
-
* ```
|
|
153
|
+
* ```ts
|
|
154
154
|
* import { SES, SendRawEmailCommand } from '\@aws-sdk/client-ses'
|
|
155
155
|
*
|
|
156
156
|
* const ses = new SES({
|
|
@@ -344,7 +344,7 @@ export interface Partial {
|
|
|
344
344
|
* and return the template as a string.
|
|
345
345
|
*
|
|
346
346
|
* @example
|
|
347
|
-
* ```
|
|
347
|
+
* ```ts
|
|
348
348
|
* import { EmailPlugin, TemplateLoader } from '\@vendure/email-plugin';
|
|
349
349
|
*
|
|
350
350
|
* class MyTemplateLoader implements TemplateLoader {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure/email-plugin",
|
|
3
|
-
"version": "2.1.0-next.
|
|
3
|
+
"version": "2.1.0-next.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"@types/fs-extra": "^9.0.1",
|
|
36
36
|
"@types/handlebars": "^4.1.0",
|
|
37
37
|
"@types/mjml": "^4.0.4",
|
|
38
|
-
"@vendure/common": "2.1.0-next.
|
|
39
|
-
"@vendure/core": "2.1.0-next.
|
|
38
|
+
"@vendure/common": "2.1.0-next.5",
|
|
39
|
+
"@vendure/core": "2.1.0-next.5",
|
|
40
40
|
"rimraf": "^3.0.2",
|
|
41
41
|
"typescript": "4.9.5"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "b4b78ba7ac534e5995877e46421870b114f429de"
|
|
44
44
|
}
|