mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-13 18:18:15 +03:00
Initial email settings UI commit
Added email settings page, settings now save in database, ability to send an email to client when it's created
This commit is contained in:
parent
f8a10417ea
commit
c31636b66e
9 changed files with 568 additions and 25 deletions
emailer
|
@ -20,7 +20,7 @@ type SmtpMail struct {
|
|||
from string
|
||||
}
|
||||
|
||||
func authType(authType string) mail.AuthType {
|
||||
func AuthType(authType string) mail.AuthType {
|
||||
switch strings.ToUpper(authType) {
|
||||
case "PLAIN":
|
||||
return mail.AuthPlain
|
||||
|
@ -31,7 +31,7 @@ func authType(authType string) mail.AuthType {
|
|||
}
|
||||
}
|
||||
|
||||
func encryptionType(encryptionType string) mail.Encryption {
|
||||
func EncryptionType(encryptionType string) mail.Encryption {
|
||||
switch strings.ToUpper(encryptionType) {
|
||||
case "SSL":
|
||||
return mail.EncryptionSSL
|
||||
|
@ -45,7 +45,7 @@ func encryptionType(encryptionType string) mail.Encryption {
|
|||
}
|
||||
|
||||
func NewSmtpMail(hostname string, port int, username string, password string, noTLSCheck bool, auth string, fromName, from string, encryption string) *SmtpMail {
|
||||
ans := SmtpMail{hostname: hostname, port: port, username: username, password: password, noTLSCheck: noTLSCheck, fromName: fromName, from: from, authType: authType(auth), encryption: encryptionType(encryption)}
|
||||
ans := SmtpMail{hostname: hostname, port: port, username: username, password: password, noTLSCheck: noTLSCheck, fromName: fromName, from: from, authType: AuthType(auth), encryption: EncryptionType(encryption)}
|
||||
return &ans
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue