@h3ravel/mail 11.0.16 → 11.0.17-alpha.10
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/dist/index.cjs +15 -7
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -1
- package/package.json +2 -3
package/dist/index.cjs
CHANGED
|
@@ -6,12 +6,16 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
return to;
|
|
17
21
|
};
|
|
@@ -210,7 +214,11 @@ var Mailer = class {
|
|
|
210
214
|
async send(mailable) {
|
|
211
215
|
await mailable.build();
|
|
212
216
|
const options = mailable.getMessageOptions();
|
|
213
|
-
if (options.viewPath && !options.html)
|
|
217
|
+
if (options.viewPath && !options.html) {
|
|
218
|
+
let view = await this.edgeRenderer(options.viewPath, options.viewData || {});
|
|
219
|
+
if (typeof view !== "string") view = String(view.body);
|
|
220
|
+
options.html = view;
|
|
221
|
+
}
|
|
214
222
|
try {
|
|
215
223
|
return this.driver.send(options);
|
|
216
224
|
} catch {
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import SMTPConnection from "nodemailer/lib/smtp-connection";
|
|
|
6
6
|
import * as nodemailer_lib_sendmail_transport0 from "nodemailer/lib/sendmail-transport";
|
|
7
7
|
import SendmailTransport from "nodemailer/lib/sendmail-transport";
|
|
8
8
|
import * as nodemailer_lib_smtp_transport0 from "nodemailer/lib/smtp-transport";
|
|
9
|
+
import { IResponsable } from "@h3ravel/contracts";
|
|
9
10
|
import { Application, ServiceProvider } from "@h3ravel/core";
|
|
10
11
|
|
|
11
12
|
//#region src/Contracts/Mailer.d.ts
|
|
@@ -118,7 +119,7 @@ declare abstract class Mailable {
|
|
|
118
119
|
declare class Mailer {
|
|
119
120
|
private driver;
|
|
120
121
|
private edgeRenderer;
|
|
121
|
-
constructor(driver: MailDriverContract, edgeRenderer: (viewPath: string, data: Record<string, any>) => Promise<string>);
|
|
122
|
+
constructor(driver: MailDriverContract, edgeRenderer: (viewPath: string, data: Record<string, any>) => Promise<IResponsable | string>);
|
|
122
123
|
send(mailable: Mailable): Promise<DeliveryReport | undefined | void>;
|
|
123
124
|
}
|
|
124
125
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -185,7 +185,11 @@ var Mailer = class {
|
|
|
185
185
|
async send(mailable) {
|
|
186
186
|
await mailable.build();
|
|
187
187
|
const options = mailable.getMessageOptions();
|
|
188
|
-
if (options.viewPath && !options.html)
|
|
188
|
+
if (options.viewPath && !options.html) {
|
|
189
|
+
let view = await this.edgeRenderer(options.viewPath, options.viewData || {});
|
|
190
|
+
if (typeof view !== "string") view = String(view.body);
|
|
191
|
+
options.html = view;
|
|
192
|
+
}
|
|
189
193
|
try {
|
|
190
194
|
return this.driver.send(options);
|
|
191
195
|
} catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/mail",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.17-alpha.10",
|
|
4
4
|
"description": "Mail drivers and templates system for H3ravel.",
|
|
5
5
|
"h3ravel": {
|
|
6
6
|
"providers": [
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"directory": "packages/mail"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@h3ravel/core": "^1.
|
|
34
|
+
"@h3ravel/core": "^1.22.0-alpha.10"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/nodemailer": "^6.4.17",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"nodemailer": "^7.0.5"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
|
-
"barrel": "barrelsby --directory src --delete --singleQuotes",
|
|
46
45
|
"build": "tsdown --config-loader unconfig",
|
|
47
46
|
"dev": "tsx watch src/index.ts",
|
|
48
47
|
"start": "node dist/index.js",
|