Skip to content

Commit

Permalink
Fixed __dirname variable not available in mailer.
Browse files Browse the repository at this point in the history
  • Loading branch information
shrihari-prakash committed Mar 11, 2024
1 parent 59b7ecf commit b57a114
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/service/configuration/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export class Configuration {
return this.configurations[option.name];
}
const value = (option.envName in process.env && process.env[option.envName]) || defaultValue || option.default;
console.log(name, value, process.env[option.envName])
switch (option.type) {
case "boolean":
return value === "true" || value === true;
Expand Down
4 changes: 4 additions & 0 deletions src/service/mailer/mailer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const log = Logger.getLogger().child({ from: "mailer" });
import sgMail from "@sendgrid/mail";
import nodemailer from "nodemailer";
import * as path from "path";
import {fileURLToPath} from 'url';
import * as fs from "fs";

import { Configuration } from "../../singleton/configuration.js";
Expand All @@ -12,6 +13,9 @@ import VerificationCodeModel from "../../model/mongo/verification-code.js";
import { VerificationCodeType } from "../../enum/verification-code.js";
import { v4 as uuidv4 } from "uuid";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const Modes = {
PRINT: "print",
SENDGRID: "sendgrid",
Expand Down

0 comments on commit b57a114

Please sign in to comment.