mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Add spam control basics
This commit is contained in:
parent
e10d04d22e
commit
51a0e1127e
8 changed files with 101 additions and 12 deletions
|
@ -34,6 +34,10 @@ func (m *Mailer) InviteNewUser(recipient, inviterName, inviterEmail, url, userna
|
|||
em.ReplyTo = inviterEmail
|
||||
em.ReplyName = inviterName
|
||||
|
||||
if IsBlockedEmailDomain(em.ToEmail) {
|
||||
return
|
||||
}
|
||||
|
||||
parameters := struct {
|
||||
Subject string
|
||||
Inviter string
|
||||
|
@ -83,6 +87,10 @@ func (m *Mailer) InviteExistingUser(recipient, inviterName, inviterEmail, url st
|
|||
em.ReplyTo = inviterEmail
|
||||
em.ReplyName = inviterName
|
||||
|
||||
if IsBlockedEmailDomain(em.ToEmail) {
|
||||
return
|
||||
}
|
||||
|
||||
parameters := struct {
|
||||
Subject string
|
||||
Inviter string
|
||||
|
@ -107,7 +115,7 @@ func (m *Mailer) InviteExistingUser(recipient, inviterName, inviterEmail, url st
|
|||
m.Runtime.Log.Error(fmt.Sprintf("%s - unable to send email", method), err)
|
||||
}
|
||||
if !ok {
|
||||
m.Runtime.Log.Info(fmt.Sprintf("%s unable to send email"))
|
||||
m.Runtime.Log.Info(fmt.Sprintf("%s unable to send email", method))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,6 +129,10 @@ func (m *Mailer) PasswordReset(recipient, url string) {
|
|||
em.ToEmail = recipient
|
||||
em.ToName = recipient
|
||||
|
||||
if IsBlockedEmailDomain(em.ToEmail) {
|
||||
return
|
||||
}
|
||||
|
||||
parameters := struct {
|
||||
Subject string
|
||||
URL string
|
||||
|
@ -143,6 +155,6 @@ func (m *Mailer) PasswordReset(recipient, url string) {
|
|||
m.Runtime.Log.Error(fmt.Sprintf("%s - unable to send email", method), err)
|
||||
}
|
||||
if !ok {
|
||||
m.Runtime.Log.Info(fmt.Sprintf("%s unable to send email"))
|
||||
m.Runtime.Log.Info(fmt.Sprintf("%s unable to send email", method))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue