diff --git a/app/Core/Mail/Transport/Mail.php b/app/Core/Mail/Transport/Mail.php index 0fc278d14..ffebdf14a 100644 --- a/app/Core/Mail/Transport/Mail.php +++ b/app/Core/Mail/Transport/Mail.php @@ -36,6 +36,10 @@ class Mail extends Base implements ClientInterface ->setFrom($this->helper->mail->getMailSenderAddress(), $authorName) ->setTo(array($recipientEmail => $recipientName)); + if (! empty(MAIL_BCC)) { + $message->setBcc(MAIL_BCC); + } + $headers = $message->getHeaders(); // See https://tools.ietf.org/html/rfc3834#section-5 diff --git a/app/constants.php b/app/constants.php index fcca78359..d201aa00d 100644 --- a/app/constants.php +++ b/app/constants.php @@ -106,6 +106,7 @@ defined('REMEMBER_ME_AUTH') or define('REMEMBER_ME_AUTH', getenv('REMEMBER_ME_AU // Mail configuration defined('MAIL_CONFIGURATION') or define('MAIL_CONFIGURATION', getenv('MAIL_CONFIGURATION') ? strtolower(getenv('MAIL_CONFIGURATION')) === 'true' : true); defined('MAIL_FROM') or define('MAIL_FROM', getenv('MAIL_FROM') ?: 'notifications@kanboard.local'); +defined('MAIL_BCC') or define('MAIL_BCC', getenv('MAIL_BCC') ?: ''); defined('MAIL_TRANSPORT') or define('MAIL_TRANSPORT', getenv('MAIL_TRANSPORT') ?: 'mail'); defined('MAIL_SMTP_HOSTNAME') or define('MAIL_SMTP_HOSTNAME', getenv('MAIL_SMTP_HOSTNAME') ?: ''); defined('MAIL_SMTP_PORT') or define('MAIL_SMTP_PORT', intval(getenv('MAIL_SMTP_PORT')) ?: 25); diff --git a/config.default.php b/config.default.php index d0333839b..4a6f3809b 100644 --- a/config.default.php +++ b/config.default.php @@ -44,6 +44,9 @@ define('MAIL_CONFIGURATION', true); // E-mail address used for the "From" header (notifications) define('MAIL_FROM', 'replace-me@kanboard.local'); +// E-mail address used for the "Bcc" header to send a copy of all notifications +define('MAIL_BCC', ''); + // Mail transport available: "smtp", "sendmail", "mail" (PHP mail function), "postmark", "mailgun", "sendgrid" define('MAIL_TRANSPORT', 'mail');