Add "email.senderAddress" config
This commit is contained in:
parent
b7bf2a11ea
commit
ef13c8c814
@ -25,6 +25,7 @@ import { SendGridConfiguration } from "./subconfigurations/email/SendGrid";
|
|||||||
|
|
||||||
export class EmailConfiguration {
|
export class EmailConfiguration {
|
||||||
provider: string | null = null;
|
provider: string | null = null;
|
||||||
|
senderAddress: string | null = null;
|
||||||
smtp: SMTPConfiguration = new SMTPConfiguration();
|
smtp: SMTPConfiguration = new SMTPConfiguration();
|
||||||
mailgun: MailGunConfiguration = new MailGunConfiguration();
|
mailgun: MailGunConfiguration = new MailGunConfiguration();
|
||||||
mailjet: MailJetConfiguration = new MailJetConfiguration();
|
mailjet: MailJetConfiguration = new MailJetConfiguration();
|
||||||
|
@ -187,7 +187,9 @@ export const Email: {
|
|||||||
|
|
||||||
const message = {
|
const message = {
|
||||||
from:
|
from:
|
||||||
Config.get().general.correspondenceEmail || "noreply@localhost",
|
Config.get().email.senderAddress ||
|
||||||
|
Config.get().general.correspondenceEmail ||
|
||||||
|
"noreply@localhost",
|
||||||
to: email,
|
to: email,
|
||||||
subject,
|
subject,
|
||||||
html,
|
html,
|
||||||
|
@ -27,9 +27,12 @@ export default async function () {
|
|||||||
if (!host || !port || secure === null || !username || !password)
|
if (!host || !port || secure === null || !username || !password)
|
||||||
return console.error("[Email] SMTP has not been configured correctly.");
|
return console.error("[Email] SMTP has not been configured correctly.");
|
||||||
|
|
||||||
if (!Config.get().general.correspondenceEmail)
|
if (
|
||||||
|
!Config.get().email.senderAddress &&
|
||||||
|
!Config.get().general.correspondenceEmail
|
||||||
|
)
|
||||||
return console.error(
|
return console.error(
|
||||||
"[Email] Correspondence email has not been configured! This is used as the sender email address.",
|
'[Email] You have to configure either "email_senderAddress" or "general_correspondenceEmail" for emails to work. The configured value is used as the sender address.',
|
||||||
);
|
);
|
||||||
|
|
||||||
// construct the transporter
|
// construct the transporter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user