|
|
|
@ -68,6 +68,26 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function clearSmtp() { |
|
|
|
// Delete the SMTP config |
|
|
|
try { |
|
|
|
await API.deleteConfig({ |
|
|
|
id: smtpConfig._id, |
|
|
|
rev: smtpConfig._rev, |
|
|
|
}) |
|
|
|
smtpConfig = { |
|
|
|
config: {}, |
|
|
|
} |
|
|
|
await admin.getChecklist() |
|
|
|
notifications.success(`Settings cleared`) |
|
|
|
analytics.captureEvent(Events.SMTP.SAVED) |
|
|
|
} catch (error) { |
|
|
|
notifications.error( |
|
|
|
`Failed to clear email settings, reason: ${error?.message || "Unknown"}` |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function fetchSmtp() { |
|
|
|
loading = true |
|
|
|
try { |
|
|
|
@ -156,8 +176,9 @@ |
|
|
|
</div> |
|
|
|
{/if} |
|
|
|
</Layout> |
|
|
|
<div> |
|
|
|
<div class="spectrum-ButtonGroup spectrum-Settings-buttonGroup"> |
|
|
|
<Button cta on:click={saveSmtp}>Save</Button> |
|
|
|
<Button secondary on:click={clearSmtp}>Clear</Button> |
|
|
|
</div> |
|
|
|
<Divider /> |
|
|
|
<Layout gap="XS" noPadding> |
|
|
|
@ -186,4 +207,8 @@ |
|
|
|
grid-gap: var(--spacing-l); |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
.spectrum-Settings-buttonGroup { |
|
|
|
gap: var(--spectrum-global-dimension-static-size-200); |
|
|
|
align-items: flex-end; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|