diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 181e26348..a12d6b02d 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -345,7 +345,12 @@ function send_user_an_email(MailMessage $mail, string $email, ?string $cc = null } function isTestEmailEnabled($notifiable) { - return data_get($notifiable, 'smtp_enabled') || data_get($notifiable, 'resend_enabled'); + if (data_get($notifiable, 'use_instance_email_settings') && isInstanceAdmin()) { + return true; + } else if (data_get($notifiable, 'smtp_enabled') || data_get($notifiable, 'resend_enabled') && auth()->user()->isAdminFromSession()) { + return true; + } + return false; } function isEmailEnabled($notifiable) {