@digipair/skill-sendmail 0.55.1 → 0.56.2

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/index.cjs.js CHANGED
@@ -21408,14 +21408,18 @@ var createTransport = function(transporter, defaults) {
21408
21408
 
21409
21409
  let SendMailService = class SendMailService {
21410
21410
  async send(params, _pinsSettingsList, context) {
21411
- const { from, to, subject, text, html, config = context.privates.SENDMAIL_CONFIG } = params;
21411
+ const { from, to, subject, text, html, attachments = [], config = context.privates.SENDMAIL_CONFIG } = params;
21412
21412
  const transporter = createTransport(config);
21413
21413
  const info = await transporter.sendMail({
21414
21414
  from,
21415
21415
  to,
21416
21416
  subject,
21417
21417
  text,
21418
- html
21418
+ html,
21419
+ attachments: attachments.map((attachment)=>({
21420
+ filename: attachment.filename,
21421
+ content: Buffer.from(attachment.content, 'base64')
21422
+ }))
21419
21423
  });
21420
21424
  return info;
21421
21425
  }
package/index.esm.js CHANGED
@@ -21386,14 +21386,18 @@ var createTransport = function(transporter, defaults) {
21386
21386
 
21387
21387
  let SendMailService = class SendMailService {
21388
21388
  async send(params, _pinsSettingsList, context) {
21389
- const { from, to, subject, text, html, config = context.privates.SENDMAIL_CONFIG } = params;
21389
+ const { from, to, subject, text, html, attachments = [], config = context.privates.SENDMAIL_CONFIG } = params;
21390
21390
  const transporter = createTransport(config);
21391
21391
  const info = await transporter.sendMail({
21392
21392
  from,
21393
21393
  to,
21394
21394
  subject,
21395
21395
  text,
21396
- html
21396
+ html,
21397
+ attachments: attachments.map((attachment)=>({
21398
+ filename: attachment.filename,
21399
+ content: Buffer.from(attachment.content, 'base64')
21400
+ }))
21397
21401
  });
21398
21402
  return info;
21399
21403
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-sendmail",
3
- "version": "0.55.1",
3
+ "version": "0.56.2",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"
package/schema.fr.json CHANGED
@@ -59,6 +59,18 @@
59
59
  "type": "string"
60
60
  }
61
61
  },
62
+ {
63
+ "name": "attachments",
64
+ "summary": "Pièces jointes",
65
+ "required": false,
66
+ "description": "Pièces jointes",
67
+ "schema": {
68
+ "type": "array",
69
+ "items": {
70
+ "type": "object"
71
+ }
72
+ }
73
+ },
62
74
  {
63
75
  "name": "config",
64
76
  "summary": "Configuration",
package/schema.json CHANGED
@@ -59,6 +59,18 @@
59
59
  "type": "string"
60
60
  }
61
61
  },
62
+ {
63
+ "name": "attachments",
64
+ "summary": "Attachments",
65
+ "required": false,
66
+ "description": "Attachments",
67
+ "schema": {
68
+ "type": "array",
69
+ "items": {
70
+ "type": "object"
71
+ }
72
+ }
73
+ },
62
74
  {
63
75
  "name": "config",
64
76
  "summary": "Configuration",