@tylix/mail 1.3.0 → 1.5.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.
Files changed (2) hide show
  1. package/mime.js +2 -0
  2. package/package.json +2 -2
package/mime.js CHANGED
@@ -152,6 +152,8 @@ export async function loadAttachments(list = []) {
152
152
  let content = a.content
153
153
  if (content == null && a.path) content = await fs.readFile(a.path)
154
154
  if (content == null) throw new Error(`Attachment #${i + 1} needs content or path`)
155
+ // Documents that render themselves (@tylix/pdf, @tylix/excel).
156
+ if (typeof content.toBuffer === 'function') content = await content.toBuffer()
155
157
  if (typeof content === 'string') {
156
158
  content = a.encoding === 'base64' ? Buffer.from(content, 'base64') : Buffer.from(content)
157
159
  } else if (!Buffer.isBuffer(content)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tylix/mail",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Email for any Node app: SMTP, Resend, SendGrid, Postmark, Mailgun and Amazon SES transports, templates, attachments and a test fake. Plugs into Tylix with Mailables and a mail log.",
5
5
  "license": "MIT",
6
6
  "author": "Mbiyrukzz",
@@ -57,7 +57,7 @@
57
57
  "access": "public"
58
58
  },
59
59
  "peerDependencies": {
60
- "@tylix/orm": "^1.3.0"
60
+ "@tylix/orm": "^1.5.0"
61
61
  },
62
62
  "peerDependenciesMeta": {
63
63
  "@tylix/orm": {