Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. const request = require("request-promise-native");
  2.  
  3. module.exports = {
  4. postMail: async params => {
  5. try {
  6. let url = `${GLOBAL_CONFIG.siloamEmailAPI.baseUrl}/insertemail`;
  7. const options = {
  8. headers: { "Content-Type": "application/json" },
  9. body: params,
  10. uri: url,
  11. json: true
  12. };
  13. let response = await request.post(options);
  14. return response;
  15. } catch (error) {
  16. throw {
  17. body: error,
  18. msg: "failed sending request to send SILOAM email"
  19. };
  20. }
  21. }
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement