fix(sendmail): if server not installed just stop
This commit is contained in:
@@ -11,6 +11,7 @@ import { fileURLToPath } from "url";
|
||||
import hbs from "nodemailer-express-handlebars";
|
||||
import { promisify } from "util";
|
||||
import { createLog } from "../../logger/logger.js";
|
||||
import { installed } from "../../../index.js";
|
||||
|
||||
interface HandlebarsMailOptions extends Mail.Options {
|
||||
template: string;
|
||||
@@ -25,6 +26,10 @@ interface EmailData {
|
||||
}
|
||||
|
||||
export const sendEmail = async (data: any): Promise<any> => {
|
||||
if (!installed) {
|
||||
createLog("error", "notify", "notify", "server not installed.");
|
||||
return;
|
||||
}
|
||||
let transporter: Transporter;
|
||||
let fromEmail: string | Address;
|
||||
const { data: settingData, error: settingError } = await tryCatch(
|
||||
|
||||
Reference in New Issue
Block a user