Handle case where the email plugin "from" email is not configured

This commit is contained in:
Flavio Copes
2015-12-02 18:11:18 +01:00
parent 09cbe091df
commit 48f6da2bc3

View File

@@ -270,6 +270,13 @@ class AdminController
$sitename = $this->grav['config']->get('site.title', 'Website');
$from = $this->grav['config']->get('plugins.email.from', 'noreply@getgrav.org');
if (empty($from)) {
$this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.FORGOT_EMAIL_NOT_CONFIGURED'), 'error');
$this->setRedirect('/forgot');
return true;
}
$to = $user->email;
$subject = $this->admin->translate(['PLUGIN_ADMIN.FORGOT_EMAIL_SUBJECT', $sitename]);