Compare commits

..

4 Commits

Author SHA1 Message Date
29a7472b3c 1.0.25 2020-04-26 23:24:03 +00:00
5490be1033 fix(core): update 2020-04-26 23:24:03 +00:00
6ee7c6af76 1.0.24 2020-01-23 17:31:11 +00:00
aa1750524b fix(core): update 2020-01-23 17:31:10 +00:00
6 changed files with 358 additions and 448 deletions

4
.snyk Normal file
View File

@ -0,0 +1,4 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.13.5
ignore: {}
patch: {}

View File

@ -1,5 +1,6 @@
{ {
"gitzone": { "gitzone": {
"projectType": "npm",
"module": { "module": {
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "mojoio", "gitscope": "mojoio",

777
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@mojoio/mailgun", "name": "@mojoio/mailgun",
"version": "1.0.23", "version": "1.0.25",
"private": false, "private": false,
"description": "an api abstraction package for mailgun", "description": "an api abstraction package for mailgun",
"main": "dist/index.js", "main": "dist/index.js",
@ -13,19 +13,19 @@
"format": "(gitzone format)" "format": "(gitzone format)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.0.22", "@gitzone/tsbuild": "^2.1.22",
"@gitzone/tstest": "^1.0.15", "@gitzone/tstest": "^1.0.15",
"@pushrocks/qenv": "^4.0.6", "@pushrocks/qenv": "^4.0.6",
"@pushrocks/tapbundle": "^3.2.0", "@pushrocks/tapbundle": "^3.2.1",
"@types/node": "^13.1.6", "@types/node": "^13.13.4",
"tslint": "^5.20.1", "tslint": "^6.1.1",
"tslint-config-prettier": "^1.15.0" "tslint-config-prettier": "^1.15.0"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartfile": "^7.0.6", "@pushrocks/smartfile": "^7.0.12",
"@pushrocks/smartmail": "^1.0.11", "@pushrocks/smartmail": "^1.0.11",
"@pushrocks/smartrequest": "^1.1.47", "@pushrocks/smartrequest": "^1.1.47",
"@pushrocks/smartstring": "^3.0.17" "@pushrocks/smartstring": "^3.0.18"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",

View File

@ -19,14 +19,14 @@ tap.test('should create a mailgun account', async () => {
tap.test('should create a smartmail', async () => { tap.test('should create a smartmail', async () => {
testSmartmail = new smartmail.Smartmail({ testSmartmail = new smartmail.Smartmail({
body: 'hi there. This is the body.', body: 'hi there. This is the body.',
from: 'noreply@mail.lossless.com', from: 'Lossless GmbH <noreply@mail.lossless.com>',
subject: 'hi there. This is the subject' subject: 'TestMessage from @mojoio/mailgun test'
}); });
return testSmartmail; return testSmartmail;
}); });
tap.test('should send a smartmail', async () => { tap.test('should send a smartmail', async () => {
testMailgunAccount.sendSmartMail(testSmartmail, 'sandbox@mail.git.zone'); await testMailgunAccount.sendSmartMail(testSmartmail, 'Sandbox Team <sandbox@mail.git.zone>');
}); });
tap.test('should retrieve a mail using a retrieval url', async () => { tap.test('should retrieve a mail using a retrieval url', async () => {
@ -34,7 +34,7 @@ tap.test('should retrieve a mail using a retrieval url', async () => {
if (result) { if (result) {
result.options.subject = 'hi there. This is a testmail with attachment'; result.options.subject = 'hi there. This is a testmail with attachment';
result.options.from = 'noreply@mail.lossless.com'; result.options.from = 'noreply@mail.lossless.com';
testMailgunAccount.sendSmartMail(result, 'sandbox@mail.git.zone'); await testMailgunAccount.sendSmartMail(result, 'Sandbox Team <sandbox@mail.git.zone>');
} }
}); });

View File

@ -52,7 +52,7 @@ export class MailgunAccount {
* sends a SmartMail * sends a SmartMail
*/ */
public async sendSmartMail(smartmailArg: plugins.smartmail.Smartmail<interfaces.IMailgunMessage>, toArg: string, dataArg = {}) { public async sendSmartMail(smartmailArg: plugins.smartmail.Smartmail<interfaces.IMailgunMessage>, toArg: string, dataArg = {}) {
const domain = smartmailArg.options.from.split('@')[1]; const domain = smartmailArg.options.from.split('@')[1].replace('>', '');
const formFields: plugins.smartrequest.IFormField[] = [ const formFields: plugins.smartrequest.IFormField[] = [
{ {
name: 'from', name: 'from',