Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const request = require("request-promise-native");
- module.exports = {
- postMail: async params => {
- try {
- let url = `${GLOBAL_CONFIG.siloamEmailAPI.baseUrl}/insertemail`;
- const options = {
- headers: { "Content-Type": "application/json" },
- body: params,
- uri: url,
- json: true
- };
- let response = await request.post(options);
- return response;
- } catch (error) {
- throw {
- body: error,
- msg: "failed sending request to send SILOAM email"
- };
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement