Verschieden Settings hinzugefügt (inkomplett)

This commit is contained in:
Torsten Schulz
2024-07-22 20:55:33 +02:00
parent 89842ff6c5
commit 4c12303edc
23 changed files with 269 additions and 208 deletions

View File

@@ -1,5 +1,6 @@
import nodemailer from 'nodemailer';
import i18n from '../utils/i18n.js';
import UserParamValue from '../models/type/user_param_value.js';
const transporter = nodemailer.createTransport({
host: process.env.SMTP_HOST,
@@ -23,7 +24,13 @@ export const sendPasswordResetEmail = async (email, resetLink, language) => {
await transporter.sendMail(mailOptions);
};
export const sendAccountActivationEmail = async (email, activationLink, username, resetToken, language) => {
export const sendAccountActivationEmail = async (email, activationLink, username, resetToken, languageId) => {
const languageObject = await UserParamValue.findOne({
where: {
id: languageId
}
});
const language = languageObject.value;
i18n.setLocale(language);
const mailOptions = {
from: process.env.SMTP_FROM,