@travetto/email-compiler 5.0.0-rc.2 → 5.0.0-rc.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/email-compiler",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.4",
|
|
4
4
|
"description": "Email compiling module",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"directory": "module/email-compiler"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@travetto/runtime": "^5.0.0-rc.
|
|
30
|
-
"@travetto/config": "^5.0.0-rc.
|
|
31
|
-
"@travetto/di": "^5.0.0-rc.
|
|
32
|
-
"@travetto/email": "^5.0.0-rc.
|
|
33
|
-
"@travetto/image": "^5.0.0-rc.
|
|
34
|
-
"@travetto/worker": "^5.0.0-rc.
|
|
29
|
+
"@travetto/runtime": "^5.0.0-rc.4",
|
|
30
|
+
"@travetto/config": "^5.0.0-rc.4",
|
|
31
|
+
"@travetto/di": "^5.0.0-rc.4",
|
|
32
|
+
"@travetto/email": "^5.0.0-rc.4",
|
|
33
|
+
"@travetto/image": "^5.0.0-rc.4",
|
|
34
|
+
"@travetto/worker": "^5.0.0-rc.4",
|
|
35
35
|
"@types/inline-css": "^3.0.3",
|
|
36
36
|
"html-entities": "^2.5.2",
|
|
37
37
|
"inline-css": "^4.0.2",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"sass": "^1.77.6"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@travetto/cli": "^5.0.0-rc.
|
|
42
|
+
"@travetto/cli": "^5.0.0-rc.4"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"@travetto/cli": {
|
package/support/bin/send.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MailService, EmailOptions
|
|
1
|
+
import { MailService, EmailOptions } from '@travetto/email';
|
|
2
2
|
import { MailTransportTarget } from '@travetto/email/src/internal/types';
|
|
3
3
|
import { DependencyRegistry, Injectable } from '@travetto/di';
|
|
4
4
|
|
|
@@ -45,13 +45,19 @@ export class EditorSendService {
|
|
|
45
45
|
try {
|
|
46
46
|
console.log('Sending email', { to });
|
|
47
47
|
const svc = await this.service();
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
url
|
|
54
|
-
|
|
48
|
+
if (this.ethereal) {
|
|
49
|
+
const { getTestMessageUrl } = await import('nodemailer');
|
|
50
|
+
const { default: smtp } = await import('nodemailer/lib/smtp-transport/index');
|
|
51
|
+
type SendMessage = Parameters<Parameters<(typeof smtp)['prototype']['send']>[1]>[1];
|
|
52
|
+
const info = await svc.send<SendMessage>(message);
|
|
53
|
+
const url = getTestMessageUrl(info);
|
|
54
|
+
console.log('Sent email', { to, url });
|
|
55
|
+
return { url };
|
|
56
|
+
} else {
|
|
57
|
+
await svc.send(message);
|
|
58
|
+
console.log('Sent email', { to });
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
55
61
|
} catch (err) {
|
|
56
62
|
console.warn('Failed to send email', { to, error: err });
|
|
57
63
|
throw err;
|
|
@@ -6,7 +6,7 @@ import { DependencyRegistry } from '@travetto/di';
|
|
|
6
6
|
import { EditorService } from './bin/editor';
|
|
7
7
|
|
|
8
8
|
/** The email editor compilation service and output serving */
|
|
9
|
-
@CliCommand({
|
|
9
|
+
@CliCommand({ with: { env: true } })
|
|
10
10
|
export class EmailEditorCommand {
|
|
11
11
|
|
|
12
12
|
preMain(): void {
|
|
@@ -10,7 +10,7 @@ import { EditorService } from './bin/editor';
|
|
|
10
10
|
/**
|
|
11
11
|
* CLI Entry point for running the email server
|
|
12
12
|
*/
|
|
13
|
-
@CliCommand({
|
|
13
|
+
@CliCommand({ with: { env: true } })
|
|
14
14
|
export class EmailTestCommand implements CliCommandShape {
|
|
15
15
|
|
|
16
16
|
preMain(): void {
|