Sends notice to player if they send in an email that the system can't process.
This commit is contained in:
parent
cb7835fb45
commit
3b30333835
1 changed files with 14 additions and 1 deletions
|
|
@ -45,7 +45,11 @@ func sendEventNotice(session data.Session, subject string, body string) error {
|
|||
return fmt.Errorf("unable to find GM address")
|
||||
}
|
||||
|
||||
e := email.NewEmail([]string{gm.Email}, "culpanvtt@gmail.com", subject, body)
|
||||
return sendNotice(gm.Email, subject, body)
|
||||
}
|
||||
|
||||
func sendNotice(toEmail string, subject string, body string) error {
|
||||
e := email.NewEmail([]string{toEmail}, "culpanvtt@gmail.com", subject, body)
|
||||
if e == nil {
|
||||
return fmt.Errorf("unable to construct Email object")
|
||||
}
|
||||
|
|
@ -106,6 +110,15 @@ will attend the next session.`,
|
|||
log.Default().Printf("ERROR: %s", err)
|
||||
}
|
||||
}
|
||||
if err := sendNotice(
|
||||
player.Email,
|
||||
"Unable to process response",
|
||||
fmt.Sprintf(`You have sent a response that I am unable to process. Please respond with a "yes" or "no".
|
||||
|
||||
%s`, email.Body),
|
||||
); err != nil {
|
||||
log.Default().Printf("ERROR: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue