<commit_before>const API_KEY = 'key-099572ee6cd2260a358eeb65b3eeeef8';
const DOMAIN = 'mg.dav.network';
const mailgun = require('mailgun-js')({apiKey: API_KEY, domain: DOMAIN});

const mail = async (from,to,title,body) => {
  let MAILGUN_DATA = {
    from: from,
    to: to,
    subject: title,
    text: body
  };
  //code to send mail here
  await mailgun.messages().send(MAILGUN_DATA, function (error, responseBody) {
    console.log(responseBody);
  });
  return;
};

module.exports = {
  mail
};<commit_msg>using mailcomposer for html email<commit_after>const API_KEY = 'key-099572ee6cd2260a358eeb65b3eeeef8';
const DOMAIN = 'mg.dav.network';
const mailgun = require('mailgun-js')({apiKey: API_KEY, domain: DOMAIN});
var mailcomposer = require('mailcomposer');

const mail = async (from,to,title,body) => {
  let mail = mailcomposer({
    from: from,
    to: to,
    subject: title,
    body: body,
    html: body
  });
  mail.build(function(mailBuildError, message) {
    var dataToSend = {
      to: to,
      message: message.toString('ascii')
    };
    mailgun.messages().sendMime(dataToSend, function (sendError, body) {
      if (sendError) {
        console.log(sendError);
        return;
      }
    });
  });
};

module.exports = {
  mail
};
{'fraction_non_alphanumeric': 0.14558472553699284, 'fraction_numerical': 0.028639618138424822, 'mean_word_length': 3.591240875912409, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3667117', 'n_tokens_mistral': 467, 'n_tokens_neox': 449, 'n_words': 94}