Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): allow sending test email when using config file #10351

Merged
merged 1 commit into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
message: $t('admin.notification_email_test_email_sent', { values: { email: $user.email } }),
});

dispatch('save', { notifications: config.notifications });
if (!disabled) {
dispatch('save', { notifications: config.notifications });
}
} catch (error) {
handleError(error, $t('admin.notification_email_test_email_failed'));
} finally {
Expand Down Expand Up @@ -138,8 +140,12 @@
/>

<div class="flex gap-2 place-items-center">
<Button size="sm" disabled={disabled || !config.notifications.smtp.enabled} on:click={handleSendTestEmail}
>{$t('admin.notification_email_sent_test_email_button')}
<Button size="sm" disabled={!config.notifications.smtp.enabled} on:click={handleSendTestEmail}>
{#if disabled}
{$t('admin.notification_email_test_email')}
{:else}
{$t('admin.notification_email_sent_test_email_button')}
{/if}
</Button>
{#if isSending}
<LoadingSpinner />
Expand Down
1 change: 1 addition & 0 deletions web/src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
"notification_email_port_description": "Port of the email server (e.g 25, 465, or 587)",
"notification_email_sent_test_email_button": "Send test email and save",
"notification_email_setting_description": "Settings for sending email notifications",
"notification_email_test_email": "Send test email",
"notification_email_test_email_failed": "Failed to send test email, check your values",
"notification_email_test_email_sent": "A test email has been sent to {email}. Please check your inbox.",
"notification_email_username_description": "Username to use when authenticating with the email server",
Expand Down
Loading