feat: add test email and improve on email notifications (#3018)

This commit is contained in:
dni ⚡
2025-03-05 09:53:40 +02:00
committed by GitHub
parent 9bd037b6e7
commit f61471b0f2
7 changed files with 111 additions and 30 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -1
View File
@@ -198,9 +198,13 @@ window.localisation.en = {
notifications_email_config: 'Email Configuration',
notifications_enable_email: 'Enable Email',
notifications_enable_email_desc: 'Send notfications over Email',
notifications_enable_email_desc: 'Send notfications over email',
notifications_send_test_email: 'Send test email',
notifications_send_email: 'Send email',
notifications_send_email_desc: 'Email you will send from',
notifications_send_email_username: 'Username',
notifications_send_email_username_desc:
'Username, will use the email if not set',
notifications_send_email_password: 'Send email password',
notifications_send_email_password_desc:
'Password for the email you will send from',
+24 -2
View File
@@ -438,7 +438,7 @@ window.AdminPageLogic = {
LNbits.api
.request('GET', '/admin/api/v1/restart/')
.then(response => {
Quasar.Notify.create({
this.$q.notify({
type: 'positive',
message: 'Success! Restarted Server',
icon: null
@@ -450,7 +450,29 @@ window.AdminPageLogic = {
formatDate(date) {
return moment(date * 1000).fromNow()
},
sendTestEmail() {
LNbits.api
.request(
'GET',
'/admin/api/v1/testemail',
this.g.user.wallets[0].adminkey
)
.then(response => {
if (response.data.status === 'error') {
throw new Error(response.data.message)
}
this.$q.notify({
message: 'Test email sent!',
color: 'positive'
})
})
.catch(error => {
this.$q.notify({
message: error.message,
color: 'negative'
})
})
},
getAudit() {
LNbits.api
.request('GET', '/admin/api/v1/audit', this.g.user.wallets[0].adminkey)