mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 11:26:04 +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');
|
$sitename = $this->grav['config']->get('site.title', 'Website');
|
||||||
$from = $this->grav['config']->get('plugins.email.from', 'noreply@getgrav.org');
|
$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;
|
$to = $user->email;
|
||||||
|
|
||||||
$subject = $this->admin->translate(['PLUGIN_ADMIN.FORGOT_EMAIL_SUBJECT', $sitename]);
|
$subject = $this->admin->translate(['PLUGIN_ADMIN.FORGOT_EMAIL_SUBJECT', $sitename]);
|
||||||
|
|||||||
Reference in New Issue
Block a user