fix: test emails only available for user owned smtp/resend
This commit is contained in:
parent
a96ef1bfab
commit
d32e43ef37
@ -343,6 +343,10 @@ 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');
|
||||
}
|
||||
function isEmailEnabled($notifiable)
|
||||
{
|
||||
return data_get($notifiable, 'smtp_enabled') || data_get($notifiable, 'resend_enabled') || data_get($notifiable, 'use_instance_email_settings');
|
||||
|
@ -22,7 +22,8 @@
|
||||
</x-forms.button>
|
||||
@endif
|
||||
@if (isEmailEnabled($team) &&
|
||||
auth()->user()->isAdminFromSession())
|
||||
auth()->user()->isAdminFromSession() &&
|
||||
isTestEmailEnabled($team))
|
||||
<x-forms.button onclick="sendTestEmail.showModal()"
|
||||
class="text-white normal-case btn btn-xs no-animation btn-primary">
|
||||
Send Test Email
|
||||
|
@ -22,7 +22,9 @@
|
||||
<x-forms.button type="submit">
|
||||
Save
|
||||
</x-forms.button>
|
||||
@if (isEmailEnabled($settings))
|
||||
@if (isEmailEnabled($settings) &&
|
||||
auth()->user()->isAdminFromSession() &&
|
||||
isTestEmailEnabled($settings))
|
||||
<x-forms.button onclick="sendTestEmail.showModal()"
|
||||
class="text-white normal-case btn btn-xs no-animation btn-primary">
|
||||
Send Test Email
|
||||
|
Loading…
x
Reference in New Issue
Block a user