You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
506 B
36 lines
506 B
|
4 weeks ago
|
package common_email
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/redis/go-redis/v9"
|
||
|
|
"github.com/wneessen/go-mail"
|
||
|
|
"context"
|
||
|
|
)
|
||
|
|
|
||
|
|
type Config struct {
|
||
|
|
RedisHostPort string
|
||
|
|
RedisPassword string
|
||
|
|
RedisDB int
|
||
|
|
SMTPHost string
|
||
|
|
SMTPPort int
|
||
|
|
}
|
||
|
|
|
||
|
|
type EmailMessage struct {
|
||
|
|
To string
|
||
|
|
From string
|
||
|
|
Subject string
|
||
|
|
Text string
|
||
|
|
HTML string
|
||
|
|
}
|
||
|
|
|
||
|
|
type Sender struct {
|
||
|
|
redis_client *redis.Client
|
||
|
|
ctx context.Context
|
||
|
|
}
|
||
|
|
|
||
|
|
type Router struct {
|
||
|
|
redis_client *redis.Client
|
||
|
|
smtp_client *mail.Client
|
||
|
|
ctx context.Context
|
||
|
|
}
|
||
|
|
|