6 Commits

Author SHA1 Message Date
c018435aa1 1.0.8 2020-08-15 12:58:55 +00:00
b2eb8a2f59 fix(core): update 2020-08-15 12:58:54 +00:00
9e44474348 1.0.7 2020-08-15 12:58:02 +00:00
0c44743d99 fix(core): update 2020-08-15 12:58:01 +00:00
c9fd14df8b 1.0.6 2020-08-12 16:37:02 +00:00
2a2c7d3423 fix(core): update 2020-08-12 16:37:01 +00:00
4 changed files with 27 additions and 5 deletions

View File

@ -26,17 +26,29 @@ mirror:
- docker - docker
- notpriv - notpriv
audit: auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare - npmci npm prepare
- npmci command npm install --production --ignore-scripts - npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org - npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high - npmci command npm audit --audit-level=high --only=prod --production
tags: tags:
- docker - docker
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- docker
allow_failure: true
# ==================== # ====================
# test stage # test stage
# ==================== # ====================

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartsmtp", "name": "@pushrocks/smartsmtp",
"version": "1.0.5", "version": "1.0.8",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartsmtp", "name": "@pushrocks/smartsmtp",
"version": "1.0.5", "version": "1.0.8",
"private": false, "private": false,
"description": "a module for handling smtp stuff", "description": "a module for handling smtp stuff",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@ -31,13 +31,23 @@ export class Smartsmtp {
toArg: string, toArg: string,
dataArg = {} dataArg = {}
) { ) {
const message = { const message: plugins.nodemailer.SendMailOptions = {
from: smartmailArg.options.from, from: smartmailArg.options.from,
to: toArg, to: toArg,
subject: smartmailArg.getSubject(dataArg), subject: smartmailArg.getSubject(dataArg),
text: smartmailArg.getBody(dataArg), text: smartmailArg.getBody(dataArg),
html: smartmailArg.getBody(dataArg), html: smartmailArg.getBody(dataArg),
attachments: [],
}; };
// lets add attachments from smartmailArg
for (const attachment of smartmailArg.attachments) {
message.attachments.push({
filename: attachment.parsedPath.base,
content: attachment.contentBuffer,
});
}
const response = await this.nodemailerTransport.sendMail(message); const response = await this.nodemailerTransport.sendMail(message);
return response; return response;
} }