Implement SMTP configuration

This commit is contained in:
Rene Vergara 2023-01-24 13:27:32 -06:00
parent a8e1c1b4d8
commit 1e2784f7db
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2
4 changed files with 24 additions and 0 deletions

View file

@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Added
- New configuration fields for SMTP
### Fixed ### Fixed
- Owner expiration query - Owner expiration query

View file

@ -21,6 +21,10 @@ data Config =
, c_useTls :: Bool , c_useTls :: Bool
, c_certificate :: String , c_certificate :: String
, c_key :: String , c_key :: String
, c_smtpHost :: String
, c_smtpPort :: Int
, c_smtpUser :: String
, c_smtpPwd :: String
} }
deriving (Eq, Show) deriving (Eq, Show)
@ -39,6 +43,10 @@ loadZGoConfig path = do
useTls <- require config "tls" useTls <- require config "tls"
cert <- require config "certificate" cert <- require config "certificate"
key <- require config "key" key <- require config "key"
mailHost <- require config "smtpHost"
mailPort <- require config "smtpPort"
mailUser <- require config "smtpUser"
mailPwd <- require config "smtpPwd"
return $ return $
Config Config
dbHost dbHost
@ -53,3 +61,7 @@ loadZGoConfig path = do
useTls useTls
cert cert
key key
mailHost
mailPort
mailUser
mailPwd

View file

@ -10,3 +10,7 @@ port = 3000
tls = false tls = false
certificate = "/path/to/cert.pem" certificate = "/path/to/cert.pem"
key = "/path/to/key.pem" key = "/path/to/key.pem"
mailHost = "127.0.0.1"
mailPort = 1025
mailUser = "contact@zgo.cash"
mailPwd = "uib3K8BkCPexl_wr5bYfrg"

View file

@ -10,3 +10,7 @@ port = 3000
tls = false tls = false
certificate = "/path/to/cert.pem" certificate = "/path/to/cert.pem"
key = "/path/to/key.pem" key = "/path/to/key.pem"
mailHost = "127.0.0.1"
mailPort = 1025
mailUser = "contact@zgo.cash"
mailPwd = "uib3K8BkCPexl_wr5bYfrg"