1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 07:09:43 +02:00

Add spam control basics

This commit is contained in:
Harvey Kandola 2019-04-16 12:53:22 +01:00
parent e10d04d22e
commit 51a0e1127e
8 changed files with 101 additions and 12 deletions

View file

@ -34,6 +34,10 @@ func (m *Mailer) ShareSpaceExistingUser(recipient, inviterName, inviterEmail, ur
em.ReplyTo = inviterEmail
em.ReplyName = inviterName
if IsBlockedEmailDomain(em.ToEmail) {
return
}
parameters := struct {
Subject string
Inviter string
@ -62,7 +66,7 @@ func (m *Mailer) ShareSpaceExistingUser(recipient, inviterName, inviterEmail, ur
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))
}
}
@ -83,6 +87,10 @@ func (m *Mailer) ShareSpaceNewUser(recipient, inviterName, inviterEmail, url, sp
em.ReplyTo = inviterEmail
em.ReplyName = inviterName
if IsBlockedEmailDomain(em.ToEmail) {
return
}
parameters := struct {
Subject string
Inviter string
@ -111,6 +119,6 @@ func (m *Mailer) ShareSpaceNewUser(recipient, inviterName, inviterEmail, url, sp
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))
}
}