36 lines
923 B
Go
36 lines
923 B
Go
package mailer
|
||
|
||
import (
|
||
"context"
|
||
"fmt"
|
||
"strings"
|
||
)
|
||
|
||
const passwordResetMonitorEmail = "mehmet.kececi@baggi.com.tr"
|
||
|
||
func (m *GraphMailer) SendPasswordResetMail(toEmail string, resetURL string) error {
|
||
subject := "Parola Sıfırlama"
|
||
|
||
html := fmt.Sprintf(`
|
||
<p>Merhaba,</p>
|
||
<p>Parolanızı sıfırlamak için aşağıdaki bağlantıya tıklayın:</p>
|
||
<p>
|
||
<a href="%s">Parolayı sıfırla</a>
|
||
</p>
|
||
<p style="font-size:12px;color:#666;">Bağlantı: %s</p>
|
||
<p>Bu bağlantı <strong>30 dakika</strong> geçerlidir ve tek kullanımlıktır.</p>
|
||
`, resetURL, resetURL)
|
||
|
||
recipients := []string{strings.TrimSpace(toEmail)}
|
||
monitor := strings.TrimSpace(passwordResetMonitorEmail)
|
||
if monitor != "" && !strings.EqualFold(recipients[0], monitor) {
|
||
recipients = append(recipients, monitor)
|
||
}
|
||
|
||
return m.Send(context.Background(), Message{
|
||
To: recipients,
|
||
Subject: subject,
|
||
BodyHTML: html,
|
||
})
|
||
}
|