@h3ravel/mail 11.0.17-alpha.1 → 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 CHANGED
@@ -214,7 +214,11 @@ var Mailer = class {
214
214
  async send(mailable) {
215
215
  await mailable.build();
216
216
  const options = mailable.getMessageOptions();
217
- if (options.viewPath && !options.html) options.html = await this.edgeRenderer(options.viewPath, options.viewData || {});
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
+ }
218
222
  try {
219
223
  return this.driver.send(options);
220
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) options.html = await this.edgeRenderer(options.viewPath, options.viewData || {});
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.17-alpha.1",
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.22.0-alpha.1"
34
+ "@h3ravel/core": "^1.22.0-alpha.10"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/nodemailer": "^6.4.17",