Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
2b8aadc816 | |||
1149ee6759 | |||
fa012409ff | |||
40bd96bf41 | |||
f3591bdc67 | |||
ece9508161 | |||
761d7e78de | |||
0c44cf09b4 | |||
aee7c80e26 | |||
c60702fb49 | |||
354c38a429 | |||
f477cad6e9 |
8
.gitlab/.gitlab-webide.yml
Normal file
8
.gitlab/.gitlab-webide.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
terminal:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:stable
|
||||||
|
before_script:
|
||||||
|
- npm install -g npm-check
|
||||||
|
variables:
|
||||||
|
RAILS_ENV: "test"
|
||||||
|
NODE_ENV: "test"
|
||||||
|
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mojoio/mailgun",
|
"name": "@mojoio/mailgun",
|
||||||
"version": "1.0.9",
|
"version": "1.0.15",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mojoio/mailgun",
|
"name": "@mojoio/mailgun",
|
||||||
"version": "1.0.9",
|
"version": "1.0.15",
|
||||||
"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",
|
||||||
|
@ -14,7 +14,7 @@ export class MailgunAccount {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Basic ${plugins.smartstring.base64.encode(
|
Authorization: `Basic ${plugins.smartstring.base64.encode(
|
||||||
this.apiToken
|
`api:${this.apiToken}`
|
||||||
)}`,
|
)}`,
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
}
|
}
|
||||||
@ -28,7 +28,7 @@ export class MailgunAccount {
|
|||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Basic ${plugins.smartstring.base64.encode(
|
Authorization: `Basic ${plugins.smartstring.base64.encode(
|
||||||
`api:key-a049e048b7029b9621c41b5682fadee9`
|
`api:${this.apiToken}`
|
||||||
)}`
|
)}`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -75,6 +75,10 @@ export class MailgunAccount {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const response = await this.postFormData(`/${domain}/messages`, formFields);
|
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');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user