<commit_before>// (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.

var express = require('express');
var router = express.Router();
var nodemailer = require('nodemailer');
var nodemailer = require('nodemailer');
var smtpTransport = require('nodemailer-smtp-transport');

function handleEmailResponse(error, info) {
  if (error) {
    console.log(error);
  } else {
    console.log('Message sent: ' + info.response);
  }
}

router.post('/request-access', function(req, res) {

  var data = req.body;

  if (!data.name || !data.email || !data.businessPurpose) {
    res.status(400).send({
      message: "Invalid payload.",
      recommendedActions: "Enter name, email, and businessPurpose and try again."
    });
  }

  var transport = nodemailer.createTransport(smtpTransport({
    host: 'smtp1.hp.com',
    port: 25
  }));

  var toGrommetConfig = {
    from: data.email, 
    to: '<EMAIL>', 
    subject: 'Evaluate access to ' + data.email,
    text: data.name + ' with this email: '+ data.email + ' want to access Grommet for this reason: '+ data.businessPurpose
  };

  var toRequesterConfig = {
    from: '<EMAIL>', 
    to: data.email, 
    subject: 'Welcome to Grommet!',
    text: 'Thanks for signing-up for early access to Grommet. We are going evaluate your request and will get back to you soon.'
  };

  transport.sendMail(toGrommetConfig, handleEmailResponse);
  transport.sendMail(toRequesterConfig, handleEmailResponse);

  res.sendStatus(200);
});

module.exports = router;<commit_msg>Removing HP SMTP url.<commit_after>// (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.

var express = require('express');
var router = express.Router();
var nodemailer = require('nodemailer');
var nodemailer = require('nodemailer');
var smtpTransport = require('nodemailer-smtp-transport');

function handleEmailResponse(error, info) {
  if (error) {
    console.log(error);
  } else {
    console.log('Message sent: ' + info.response);
  }
}

router.post('/request-access', function(req, res) {

  var data = req.body;

  if (!data.name || !data.email || !data.businessPurpose) {
    res.status(400).send({
      message: "Invalid payload.",
      recommendedActions: "Enter name, email, and businessPurpose and try again."
    });
  }

  var transport = nodemailer.createTransport(smtpTransport({
    host: 'url/to/stmp',
    port: 25
  }));

  var toGrommetConfig = {
    from: data.email, 
    to: '<EMAIL>', 
    subject: 'Evaluate access to ' + data.email,
    text: data.name + ' with this email: '+ data.email + ' want to access Grommet for this reason: '+ data.businessPurpose
  };

  var toRequesterConfig = {
    from: '<EMAIL>', 
    to: data.email, 
    subject: 'Welcome to Grommet!',
    text: 'Thanks for signing-up for early access to Grommet. We are going evaluate your request and will get back to you soon.'
  };

  transport.sendMail(toGrommetConfig, handleEmailResponse);
  transport.sendMail(toRequesterConfig, handleEmailResponse);

  res.sendStatus(200);
});

module.exports = router;
{'fraction_non_alphanumeric': 0.13694581280788176, 'fraction_numerical': 0.01083743842364532, 'mean_word_length': 3.781789638932496, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2524004', 'n_tokens_mistral': 1008, 'n_tokens_neox': 949, 'n_words': 256}