Skip to content

Commit

Permalink
fix(web): send test email when using config file
Browse files Browse the repository at this point in the history
  • Loading branch information
michelheusschen committed Jun 15, 2024
1 parent aea1c46 commit 4a01b38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
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

0 comments on commit 4a01b38

Please sign in to comment.