{"size": 650, "ext": "js", "max_stars_repo_path": "middlewares/registrationMailclient.js", "max_stars_repo_name": "attainu/Business-Listing", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "middlewares/registrationMailclient.js", "max_issues_repo_name": "attainu/Business-Listing", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "middlewares/registrationMailclient.js", "max_forks_repo_name": "attainu/Business-Listing", "max_forks_repo_forks_event_min_datetime": "2020-03-25T18:29:14.000Z", "max_forks_repo_forks_event_max_datetime": "2020-03-25T18:29:14.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 25.0, "max_line_length": 110, "alphanum_fraction": 0.6061538462}
// Importing nodemialer
const [nodemailer] = [require("nodemailer")];

const { EMAIL, EMAILPASSWORD, PORT } = process.env;

module.exports = async (email, secretToken) => {
  try {
    let transporter = nodemailer.createTransport({
      service: "gmail",
      auth: {
        user: EMAIL,
        pass: EMAILPASSWORD
      }
    });
    const mailOptions = {
      from: EMAIL,
      to: email,
      subject: "Account Verification",
      html: `<h3><a href='http://localhost:${PORT}/verifyEmail/client/${secretToken}'>${secretToken}</a></h3>`
    };
    await transporter.sendMail(mailOptions);
  } catch (error) {
    console.log(error);
  }
};
