2 Commits

Author SHA1 Message Date
c0b4291392 1.0.3 2020-08-12 15:09:41 +00:00
290b09623f fix(core): update 2020-08-12 15:09:41 +00:00
5 changed files with 17 additions and 20 deletions

2
package-lock.json generated
View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartsmtp",
"version": "1.0.2",
"version": "1.0.3",
"private": false,
"description": "a module for handling smtp stuff",
"main": "dist_ts/index.js",
@ -9,8 +9,7 @@
"license": "MIT",
"scripts": {
"test": "(tstest test/)",
"build": "(tsbuild)",
"format": "(gitzone format)"
"build": "(tsbuild --web)"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.0.22",

View File

@ -17,13 +17,15 @@ tap.test('should create a valid instance of Smartsmtp', async () => {
expect(testSmartsmtp).to.be.instanceOf(smartsmtp.Smartsmtp);
});
tap.test('should send a message', async () => {
const result = await testSmartsmtp.sendSmartMail(new smartmail.Smartmail({
body: '',
from: 'smartsmtp@mail.lossless.one',
subject: 'this is a test message',
}), 'sandbox@mail.git.zone');
const result = await testSmartsmtp.sendSmartMail(
new smartmail.Smartmail({
body: '',
from: 'smartsmtp@mail.lossless.one',
subject: 'this is a test message',
}),
'sandbox@mail.git.zone'
);
console.log(result);
});

View File

@ -18,8 +18,8 @@ export class Smartsmtp {
secure: true, // upgrade later with STARTTLS
auth: {
user: optionsArg.smtpUser,
pass: optionsArg.smtpPassword
}
pass: optionsArg.smtpPassword,
},
});
}
@ -36,9 +36,9 @@ export class Smartsmtp {
to: toArg,
subject: smartmailArg.getSubject(dataArg),
text: smartmailArg.getBody(dataArg),
html: smartmailArg.getBody(dataArg)
html: smartmailArg.getBody(dataArg),
};
const response = await this.nodemailerTransport.sendMail(message);
return response;
}
}
}

View File

@ -1,13 +1,9 @@
// @pushrocks scope
import * as smartmail from '@pushrocks/smartmail';
export {
smartmail
};
export { smartmail };
// third party scope
import * as nodemailer from 'nodemailer';
export {
nodemailer
};
export { nodemailer };