Merge pull request #985 from Puyodead1/fix/email
fix a few issues with emails
This commit is contained in:
commit
515a1a5efd
@ -45,7 +45,7 @@ router.post(
|
|||||||
|
|
||||||
const config = Config.get();
|
const config = Config.get();
|
||||||
|
|
||||||
if (config.register.requireCaptcha) {
|
if (config.register.requireCaptcha && config.security.captcha.enabled) {
|
||||||
const { sitekey, service } = config.security.captcha;
|
const { sitekey, service } = config.security.captcha;
|
||||||
|
|
||||||
if (!captcha_key) {
|
if (!captcha_key) {
|
||||||
|
@ -27,7 +27,14 @@ import MailJet from "./transports/MailJet";
|
|||||||
import SendGrid from "./transports/SendGrid";
|
import SendGrid from "./transports/SendGrid";
|
||||||
import SMTP from "./transports/SMTP";
|
import SMTP from "./transports/SMTP";
|
||||||
|
|
||||||
const ASSET_FOLDER_PATH = path.join(__dirname, "..", "..", "..", "assets");
|
const ASSET_FOLDER_PATH = path.join(
|
||||||
|
__dirname,
|
||||||
|
"..",
|
||||||
|
"..",
|
||||||
|
"..",
|
||||||
|
"..",
|
||||||
|
"assets",
|
||||||
|
);
|
||||||
export const EMAIL_REGEX =
|
export const EMAIL_REGEX =
|
||||||
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||||
|
|
||||||
@ -141,7 +148,7 @@ export const Email: {
|
|||||||
// loop through all replacements and replace them in the template
|
// loop through all replacements and replace them in the template
|
||||||
for (const [key, value] of Object.values(replacements)) {
|
for (const [key, value] of Object.values(replacements)) {
|
||||||
if (!value) continue;
|
if (!value) continue;
|
||||||
template = template.replace(key as string, value);
|
template = template.replaceAll(key as string, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return template;
|
return template;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user