Emailing management, administration improvement, Carpooling in multimodal search

This commit is contained in:
2022-10-17 05:02:19 +02:00
parent 23f4603dec
commit c2c6a72f81
82 changed files with 1778 additions and 163 deletions

22
renderer/mailer.go Normal file
View File

@@ -0,0 +1,22 @@
package renderer
import (
"fmt"
"git.coopgo.io/coopgo-platform/emailing"
"github.com/spf13/viper"
)
func NewEmailingHandler(cfg *viper.Viper) (*emailing.Mailer, error) {
templates_dir := cfg.GetString("templates.root")
theme := viper.New()
theme.SetConfigName("config")
theme.AddConfigPath(templates_dir)
err := theme.ReadInConfig()
if err != nil {
panic(fmt.Errorf("fatal error config file: %w", err))
}
return emailing.NewMailer(templates_dir, theme.Sub("emails"), cfg.Sub("emailing.smtp"))
}