Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
2b8aadc816 | |||
1149ee6759 | |||
fa012409ff | |||
40bd96bf41 | |||
f3591bdc67 | |||
ece9508161 | |||
761d7e78de | |||
0c44cf09b4 | |||
aee7c80e26 | |||
c60702fb49 | |||
354c38a429 | |||
f477cad6e9 | |||
631aaadb43 | |||
a831cf7e9a |
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",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.15",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mojoio/mailgun",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.15",
|
||||
"private": false,
|
||||
"description": "an api abstraction package for mailgun",
|
||||
"main": "dist/index.js",
|
||||
|
@ -25,7 +25,7 @@ tap.test('should create a smartmail', async () => {
|
||||
});
|
||||
|
||||
tap.test('should send a smartmail', async () => {
|
||||
testMailgunAccount.sendSmartMail(testSmartmail, 'phil@lossless.com');
|
||||
testMailgunAccount.sendSmartMail(testSmartmail, 'sandbox@mail.git.zone');
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
@ -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(
|
||||
`api:key-a049e048b7029b9621c41b5682fadee9`
|
||||
`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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user