mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-30 01:36:27 +01:00
Handle case where the email plugin "from" email is not configured
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user