update
This commit is contained in:
30
config/mail-config.go
Normal file
30
config/mail-config.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type MailConfig struct {
|
||||
SMTPHost string
|
||||
SMTPPort int
|
||||
SMTPSenderName string
|
||||
AuthEmail string
|
||||
AuthPassword string
|
||||
}
|
||||
|
||||
func Mail() *MailConfig {
|
||||
port, err := strconv.Atoi(os.Getenv("SMTP_PORT"))
|
||||
if err != nil {
|
||||
fmt.Println("error parsing to int", err.Error())
|
||||
}
|
||||
|
||||
return &MailConfig{
|
||||
SMTPHost: os.Getenv("SMTP_HOST"),
|
||||
SMTPPort: port,
|
||||
SMTPSenderName: os.Getenv("SMTP_SENDER"),
|
||||
AuthEmail: os.Getenv("AUTH_EMAIL"),
|
||||
AuthPassword: os.Getenv("AUTH_PASSWORD"),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user