This commit is contained in:
2026-10-03 12:46:38 +07:00
parent c16c1ed5ac
commit 7a972ea960
45 changed files with 75 additions and 26 deletions
@@ -1,7 +1,9 @@
// Package email_sender sends email messages over SMTP.
package email_sender
import "context"
// Message describes an email message.
type Message struct {
To string
Subject string
@@ -9,6 +11,7 @@ type Message struct {
HTML string
}
// IEmailSender sends email messages.
type IEmailSender interface {
Send(ctx context.Context, message Message) error
}
+1
View File
@@ -26,6 +26,7 @@ type sender struct {
tlsConfig *tls.Config
}
// NewSender creates an SMTP email sender.
func NewSender(
smtpHost string,
smtpPort string,
@@ -2,6 +2,7 @@ package email_sender
import "html"
// ButtonHTML returns an HTML button linking to link.
func ButtonHTML(link, label string) string {
return `<table role="presentation" cellpadding="0" cellspacing="0" style="margin:20px 0;">
<tr><td class="email-button" bgcolor="#342a22" style="border-radius:5px; background-color:#342a22;">