Compare commits

..

2 Commits

Author SHA1 Message Date
aee7c80e26 1.0.11 2019-10-28 16:15:16 +01:00
c60702fb49 fix(core): update 2019-10-28 16:15:16 +01:00
3 changed files with 9 additions and 5 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/mailgun",
"version": "1.0.10",
"version": "1.0.11",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/mailgun",
"version": "1.0.10",
"version": "1.0.11",
"private": false,
"description": "an api abstraction package for mailgun",
"main": "dist/index.js",

View File

@ -14,7 +14,7 @@ export class MailgunAccount {
method: 'GET',
headers: {
Authorization: `Basic ${plugins.smartstring.base64.encode(
this.apiToken
`api:${this.apiToken}`
)}`,
'Content-Type': 'application/json'
}
@ -28,7 +28,7 @@ export class MailgunAccount {
{
headers: {
Authorization: `Basic ${plugins.smartstring.base64.encode(
this.apiToken
`api:${this.apiToken}`
)}`
}
},
@ -75,6 +75,10 @@ export class MailgunAccount {
}
const response = await this.postFormData(`/${domain}/messages`, formFields);
console.log(response);
if (response.statusCode === 200) {
return response.body;
} else {
throw new Error('could not send email');
}
}
}