Updates to Email settings/manager to include test email

This commit is contained in:
daVinci2793 2023-06-12 04:53:51 +00:00
parent b8ca6671fc
commit d54edb93d6
15 changed files with 22 additions and 1 deletions

View File

@ -34,6 +34,9 @@
<div class="w-full md:w-1/2 px-1"> <div class="w-full md:w-1/2 px-1">
<ui-text-input-with-label ref="fromInput" v-model="newSettings.fromAddress" :disabled="savingSettings" :label="$strings.LabelEmailSettingsFromAddress" /> <ui-text-input-with-label ref="fromInput" v-model="newSettings.fromAddress" :disabled="savingSettings" :label="$strings.LabelEmailSettingsFromAddress" />
</div> </div>
<div class="w-full md:w-1/2 px-1">
<ui-text-input-with-label ref="testInput" v-model="newSettings.testAddress" :disabled="savingSettings" :label="$strings.LabelEmailSettingsTestAddress" />
</div>
</div> </div>
<div class="flex items-center justify-between pt-4"> <div class="flex items-center justify-between pt-4">
@ -93,6 +96,7 @@ export default {
secure: true, secure: true,
user: null, user: null,
pass: null, pass: null,
testAddress: null,
fromAddress: null fromAddress: null
}, },
newEReaderDevice: { newEReaderDevice: {
@ -196,6 +200,7 @@ export default {
secure: this.newSettings.secure, secure: this.newSettings.secure,
user: this.newSettings.user, user: this.newSettings.user,
pass: this.newSettings.pass, pass: this.newSettings.pass,
testAddress: this.newSettings.testAddress,
fromAddress: this.newSettings.fromAddress fromAddress: this.newSettings.fromAddress
} }
this.savingSettings = true this.savingSettings = true

View File

@ -228,6 +228,7 @@
"LabelEdit": "Bearbeiten", "LabelEdit": "Bearbeiten",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
"LabelEmailSettingsTestAddress": "Test Address",
"LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecure": "Secure",
"LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)",
"LabelEmbeddedCover": "Eingebettetes Cover", "LabelEmbeddedCover": "Eingebettetes Cover",

View File

@ -228,6 +228,7 @@
"LabelEdit": "Edit", "LabelEdit": "Edit",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
"LabelEmailSettingsTestAddress": "Test Address",
"LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecure": "Secure",
"LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)",
"LabelEmbeddedCover": "Embedded Cover", "LabelEmbeddedCover": "Embedded Cover",

View File

@ -228,6 +228,7 @@
"LabelEdit": "Editar", "LabelEdit": "Editar",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
"LabelEmailSettingsTestAddress": "Test Address",
"LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecure": "Secure",
"LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)",
"LabelEmbeddedCover": "Portada Integrada", "LabelEmbeddedCover": "Portada Integrada",

View File

@ -228,6 +228,7 @@
"LabelEdit": "Modifier", "LabelEdit": "Modifier",
"LabelEmail": "E-mail", "LabelEmail": "E-mail",
"LabelEmailSettingsFromAddress": "Expéditeur", "LabelEmailSettingsFromAddress": "Expéditeur",
"LabelEmailSettingsTestAddress": "Test Address",
"LabelEmailSettingsSecure": "Sécurisé", "LabelEmailSettingsSecure": "Sécurisé",
"LabelEmailSettingsSecureHelp": "Si coché, la connexion utilisera TLS lors de la connexion au serveur. Sinon TLS est utilisé si le serveur prend en charge l'extension STARTTLS. Dans la plupart des cas, cochez si vous vous connectez au port 465. Décochez pour le port 587 ou 25. (source: nodemailer.com/smtp/#authentication)", "LabelEmailSettingsSecureHelp": "Si coché, la connexion utilisera TLS lors de la connexion au serveur. Sinon TLS est utilisé si le serveur prend en charge l'extension STARTTLS. Dans la plupart des cas, cochez si vous vous connectez au port 465. Décochez pour le port 587 ou 25. (source: nodemailer.com/smtp/#authentication)",
"LabelEmbeddedCover": "Couverture du livre intégrée", "LabelEmbeddedCover": "Couverture du livre intégrée",

View File

@ -228,6 +228,7 @@
"LabelEdit": "Edit", "LabelEdit": "Edit",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
"LabelEmailSettingsTestAddress": "Test Address",
"LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecure": "Secure",
"LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)",
"LabelEmbeddedCover": "Embedded Cover", "LabelEmbeddedCover": "Embedded Cover",

View File

@ -228,6 +228,7 @@
"LabelEdit": "Edit", "LabelEdit": "Edit",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
"LabelEmailSettingsTestAddress": "Test Address",
"LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecure": "Secure",
"LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)",
"LabelEmbeddedCover": "Embedded Cover", "LabelEmbeddedCover": "Embedded Cover",

View File

@ -228,6 +228,7 @@
"LabelEdit": "Uredi", "LabelEdit": "Uredi",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
"LabelEmailSettingsTestAddress": "Test Address",
"LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecure": "Secure",
"LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)",
"LabelEmbeddedCover": "Embedded Cover", "LabelEmbeddedCover": "Embedded Cover",

View File

@ -228,6 +228,7 @@
"LabelEdit": "Modifica", "LabelEdit": "Modifica",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
"LabelEmailSettingsTestAddress": "Test Address",
"LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecure": "Secure",
"LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)",
"LabelEmbeddedCover": "Embedded Cover", "LabelEmbeddedCover": "Embedded Cover",

View File

@ -228,6 +228,7 @@
"LabelEdit": "Wijzig", "LabelEdit": "Wijzig",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
"LabelEmailSettingsTestAddress": "Test Address",
"LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecure": "Secure",
"LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)",
"LabelEmbeddedCover": "Ingesloten cover", "LabelEmbeddedCover": "Ingesloten cover",

View File

@ -228,6 +228,7 @@
"LabelEdit": "Edytuj", "LabelEdit": "Edytuj",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
"LabelEmailSettingsTestAddress": "Test Address",
"LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecure": "Secure",
"LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)",
"LabelEmbeddedCover": "Embedded Cover", "LabelEmbeddedCover": "Embedded Cover",

View File

@ -228,6 +228,7 @@
"LabelEdit": "Редактировать", "LabelEdit": "Редактировать",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
"LabelEmailSettingsTestAddress": "Test Address",
"LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecure": "Secure",
"LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)",
"LabelEmbeddedCover": "Embedded Cover", "LabelEmbeddedCover": "Embedded Cover",

View File

@ -228,6 +228,7 @@
"LabelEdit": "编辑", "LabelEdit": "编辑",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
"LabelEmailSettingsTestAddress": "Test Address",
"LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecure": "Secure",
"LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)",
"LabelEmbeddedCover": "嵌入封面", "LabelEmbeddedCover": "嵌入封面",

View File

@ -26,7 +26,7 @@ class EmailManager {
transporter.sendMail({ transporter.sendMail({
from: this.db.emailSettings.fromAddress, from: this.db.emailSettings.fromAddress,
to: this.db.emailSettings.fromAddress, to: this.db.emailSettings.testAddress,
subject: 'Test email from Audiobookshelf', subject: 'Test email from Audiobookshelf',
text: 'Success!' text: 'Success!'
}).then((result) => { }).then((result) => {
@ -54,6 +54,7 @@ class EmailManager {
transporter.sendMail({ transporter.sendMail({
from: this.db.emailSettings.fromAddress, from: this.db.emailSettings.fromAddress,
to: device.email, to: device.email,
subject: "Here is your Ebook!",
html: '<div dir="auto"></div>', html: '<div dir="auto"></div>',
attachments: [ attachments: [
{ {

View File

@ -10,6 +10,7 @@ class EmailSettings {
this.secure = true this.secure = true
this.user = null this.user = null
this.pass = null this.pass = null
this.testAddress = null
this.fromAddress = null this.fromAddress = null
// Array of { name:String, email:String } // Array of { name:String, email:String }
@ -26,6 +27,7 @@ class EmailSettings {
this.secure = !!settings.secure this.secure = !!settings.secure
this.user = settings.user this.user = settings.user
this.pass = settings.pass this.pass = settings.pass
this.testAddress = settings.testAddress
this.fromAddress = settings.fromAddress this.fromAddress = settings.fromAddress
this.ereaderDevices = settings.ereaderDevices?.map(d => ({ ...d })) || [] this.ereaderDevices = settings.ereaderDevices?.map(d => ({ ...d })) || []
} }
@ -38,6 +40,7 @@ class EmailSettings {
secure: this.secure, secure: this.secure,
user: this.user, user: this.user,
pass: this.pass, pass: this.pass,
testAddress: this.testAddress,
fromAddress: this.fromAddress, fromAddress: this.fromAddress,
ereaderDevices: this.ereaderDevices.map(d => ({ ...d })) ereaderDevices: this.ereaderDevices.map(d => ({ ...d }))
} }