mailchimp-buddy
Advanced tools
Comparing version 0.0.3 to 0.1.0
@@ -16,3 +16,4 @@ import { AxiosResponse } from 'axios'; | ||
subscribeIfNew(email: string): Promise<AxiosResponse<any>>; | ||
unsubscribeIfNew(email: string): Promise<AxiosResponse<any>>; | ||
remove(email: string): Promise<AxiosResponse<any>>; | ||
}; |
@@ -41,2 +41,8 @@ "use strict"; | ||
}, | ||
unsubscribeIfNew(email) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const data = { email_address: email, status_if_new: 'unsubscribed' }; | ||
return yield axios_1.default.put(`${baseUrl}/${md5(email)}`, data, { headers }); | ||
}); | ||
}, | ||
remove(email) { | ||
@@ -43,0 +49,0 @@ return __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "mailchimp-buddy", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
@@ -40,2 +40,7 @@ import * as crypto from 'crypto'; | ||
async unsubscribeIfNew(email: string) { | ||
const data = { email_address: email, status_if_new: 'unsubscribed' }; | ||
return await axios.put(`${baseUrl}/${md5(email)}`, data, { headers }); | ||
}, | ||
async remove(email: string) { | ||
@@ -42,0 +47,0 @@ return await axios.delete(`${baseUrl}/${md5(email)}`, { headers }); |
5861
130