Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
9e44474348 | |||
0c44743d99 | |||
c9fd14df8b | |||
2a2c7d3423 |
@ -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
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartsmtp",
|
"name": "@pushrocks/smartsmtp",
|
||||||
"version": "1.0.5",
|
"version": "1.0.7",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartsmtp",
|
"name": "@pushrocks/smartsmtp",
|
||||||
"version": "1.0.5",
|
"version": "1.0.7",
|
||||||
"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",
|
||||||
|
12
ts/index.ts
12
ts/index.ts
@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user