@andrey4emk/npm-app-back-b24 0.5.15 → 0.5.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrey4emk/npm-app-back-b24",
3
- "version": "0.5.15",
3
+ "version": "0.5.16",
4
4
  "description": "Bitrix24 OAuth helpers for Node.js projects",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,16 +1,17 @@
1
1
  import nodemailer from "nodemailer";
2
2
 
3
3
  /**
4
- * @param emailAuth - объект с данными для авторизации в почте
5
- * @param emailAuth.user - пользователь (почта)
6
- * @param emailAuth.pass - пароль или app password
4
+ * @param auth - объект с данными для авторизации в почте
5
+ * @param auth.user - пользователь (почта)
6
+ * @param auth.pass - пароль или app password
7
7
  */
8
8
  export class Email {
9
- constructor(emailAuth) {
9
+ constructor(auth) {
10
+ this.auth = auth;
10
11
  this.transporter = nodemailer.createTransport({
11
12
  auth: {
12
- user: emailAuth.user,
13
- pass: emailAuth.pass,
13
+ user: this.auth.user,
14
+ pass: this.auth.pass,
14
15
  },
15
16
  host: "smtp.yandex.ru",
16
17
  port: 465, // 465 = SMTPS, 587 = STARTTLS
@@ -46,8 +47,8 @@ export class Email {
46
47
  }
47
48
 
48
49
  const info = await this.transporter.sendMail({
49
- from: `Натяжные потолки Репа. <${this.emailAuth.user}>`, // адрес отправителя
50
- to: [dataMail.to, this.emailAuth.user], // строка или массив адресов
50
+ from: `Натяжные потолки Репа. <${this.auth.user}>`, // адрес отправителя
51
+ to: [dataMail.to, this.auth.user], // строка или массив адресов
51
52
  subject: dataMail.subject,
52
53
  text: dataMail.text,
53
54
  html: dataMail.html, // html-версия