Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Email config in the .env doesn't appear as expected #7078

Merged
merged 2 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/Config/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

class Email extends BaseConfig
{
public string $fromEmail;
public string $fromName;
public string $recipients;
public string $fromEmail = '';
public string $fromName = '';
public string $recipients = '';

/**
* The "user agent"
Expand All @@ -28,17 +28,17 @@ class Email extends BaseConfig
/**
* SMTP Server Address
*/
public string $SMTPHost;
public string $SMTPHost = '';

/**
* SMTP Username
*/
public string $SMTPUser;
public string $SMTPUser = '';

/**
* SMTP Password
*/
public string $SMTPPass;
public string $SMTPPass = '';

/**
* SMTP Port
Expand Down
6 changes: 5 additions & 1 deletion system/Email/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,11 @@ public function send($autoClear = true)
$this->setReplyTo($this->headers['From']);
}

if (empty($this->recipients) && ! isset($this->headers['To']) && empty($this->BCCArray) && ! isset($this->headers['Bcc']) && ! isset($this->headers['Cc'])) {
if (
empty($this->recipients) && ! isset($this->headers['To'])
&& empty($this->BCCArray) && ! isset($this->headers['Bcc'])
&& ! isset($this->headers['Cc'])
) {
$this->setErrorMessage(lang('Email.noRecipients'));

return false;
Expand Down