@pixelplex/mail-service 0.1.21-attachments → 0.1.21-file

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.
@@ -1,20 +1,22 @@
1
1
  import { OnApplicationBootstrap } from '@nestjs/common';
2
2
  import { ClientProxy } from '@nestjs/microservices';
3
3
  import { Observable } from 'rxjs';
4
+ import { Attachment } from 'nodemailer/lib/mailer';
4
5
  export declare class MailService implements OnApplicationBootstrap {
5
6
  private logger;
6
7
  client: ClientProxy;
7
8
  clientRecovery: ClientProxy;
8
9
  onApplicationBootstrap(): Promise<void>;
9
10
  /**
10
- * @param to - email to send the message to
11
- * @param type - the type of message to send. files `{type}.handlebars` and `{type}.subject.handlebars` will used
12
- * @param payload - object with payload to build you mail
13
- * @param ttl - the number of seconds after which the message will be rejected from the queue if,
14
- * but only if it was processed with an error. Set 0 if you think your message should live until
15
- * it is successfully sent.
11
+ * @param to - email to send the message to
12
+ * @param type - the type of message to send. files `{type}.handlebars` and `{type}.subject.handlebars` will used
13
+ * @param payload - object with payload to build you mail
14
+ * @param attachments - array of files to attach to mail
15
+ * @param ttl - the number of seconds after which the message will be rejected from the queue if,
16
+ * but only if it was processed with an error. Set 0 if you think your message should live until
17
+ * it is successfully sent.
16
18
  */
17
19
  sendMail<TResult = any>(to: string, type: string, payload?: {
18
20
  [key: string]: unknown;
19
- }, ttl?: number): Observable<TResult>;
21
+ }, ttl?: number, attachments?: Attachment[]): Observable<TResult>;
20
22
  }
@@ -29,20 +29,22 @@ let MailService = class MailService {
29
29
  this.logger.log('RMQ Connected');
30
30
  }
31
31
  /**
32
- * @param to - email to send the message to
33
- * @param type - the type of message to send. files `{type}.handlebars` and `{type}.subject.handlebars` will used
34
- * @param payload - object with payload to build you mail
35
- * @param ttl - the number of seconds after which the message will be rejected from the queue if,
36
- * but only if it was processed with an error. Set 0 if you think your message should live until
37
- * it is successfully sent.
32
+ * @param to - email to send the message to
33
+ * @param type - the type of message to send. files `{type}.handlebars` and `{type}.subject.handlebars` will used
34
+ * @param payload - object with payload to build you mail
35
+ * @param attachments - array of files to attach to mail
36
+ * @param ttl - the number of seconds after which the message will be rejected from the queue if,
37
+ * but only if it was processed with an error. Set 0 if you think your message should live until
38
+ * it is successfully sent.
38
39
  */
39
- sendMail(to, type, payload, ttl = 0) {
40
+ sendMail(to, type, payload, ttl = 0, attachments) {
40
41
  return this.client.emit('new_mail', {
41
42
  type,
42
43
  payload,
43
44
  to,
44
45
  timestamp: new Date().getTime(),
45
46
  ttl,
47
+ attachments,
46
48
  });
47
49
  }
48
50
  };
@@ -1 +1 @@
1
- {"version":3,"file":"app.service.js","sourceRoot":"","sources":["../../src/connect/app.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4E;AAC5E,yDAA4D;AAC5D,+BAAyC;AACzC,8CAAwD;AAExD,mCAA4B;AAG5B,IAAa,WAAW,GAAxB,MAAa,WAAW;IAAxB;QACU,WAAM,GAAW,IAAI,eAAM,CAAC,mBAAmB,CAAC,CAAC;IAwC3D,CAAC;IAhCC,KAAK,CAAC,sBAAsB;QAC1B,MAAM,YAAK,CAAC,KAAK,IAAI,EAAE;YACrB,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YAC5B,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QACtC,CAAC,CAAC;aACC,IAAI,CAAC,eAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;aACrB,SAAS,EAAE,CAAC;QACf,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CACN,EAAU,EACV,IAAY,EACZ,OAAoC,EACpC,MAAc,CAAC;QAEf,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAuB,UAAU,EAAE;YACxD,IAAI;YACJ,OAAO;YACP,EAAE;YACF,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,OAA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BAAW;2CAAC;AAGpB;IADC,sBAAM,CAAC,qBAAQ,CAAC;8BACD,2BAAW;mDAAC;AAPjB,WAAW;IADvB,mBAAU,EAAE;GACA,WAAW,CA4CvB;AA5CY,kCAAW"}
@@ -2497,8 +2497,8 @@
2497
2497
  "affectsGlobalScope": false
2498
2498
  },
2499
2499
  "../src/connect/app.service.ts": {
2500
- "version": "432256fad9934c875d9951fb289aca55f7af9c229ac4d95007644da6c009377d",
2501
- "signature": "3a2a5a3ae4859ce6e5b358b7e3fd8924a91d3337e94c00a92f247883c7ad3823",
2500
+ "version": "a24595f0b180371fdc60d842c5b23875afcff3b2b6d04f73f5803f1a320d92e8",
2501
+ "signature": "ae190d9aa297a057e29e225f55e4b34af5f3e76de907ee3d73eb8b63402f9d4c",
2502
2502
  "affectsGlobalScope": false
2503
2503
  },
2504
2504
  "../src/connect/app.module.ts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixelplex/mail-service",
3
- "version": "0.1.21-attachments",
3
+ "version": "0.1.21-file",
4
4
  "description": "Mail service",
5
5
  "author": "dev@pixelplex.io",
6
6
  "private": false,