Skip to content

Commit

Permalink
Add blackmail.HeadersAutoreply() to most emails
Browse files Browse the repository at this point in the history
I'm getting some "Thanks for your inquiry" backscatter.
  • Loading branch information
arp242 committed Nov 5, 2024
1 parent 530ab5e commit 5c678bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cron/email_reports.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func emailReports(ctx context.Context) error {
err = blackmail.Send(subject,
blackmail.From("GoatCounter reports", goatcounter.Config(ctx).EmailFrom),
blackmail.To(user.Email),
blackmail.HeadersAutoreply(),
blackmail.BodyText(text),
blackmail.BodyHTML(html))
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions export.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ func (e *Export) Run(ctx context.Context, fp *os.File, mailUser bool) {
err = blackmail.Send("GoatCounter export ready",
blackmail.From("GoatCounter export", Config(ctx).EmailFrom),
blackmail.To(user.Email),
blackmail.HeadersAutoreply(),
blackmail.BodyMustText(TplEmailExportDone{ctx, *site, *user, *e}.Render))
if err != nil {
l.Error(err)
Expand Down
1 change: 1 addition & 0 deletions handlers/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ func (h settings) exportImport(w http.ResponseWriter, r *http.Request) error {
sendErr := blackmail.Send("GoatCounter import error",
blackmail.From("GoatCounter import", goatcounter.Config(r.Context()).EmailFrom),
blackmail.To(user.Email),
blackmail.HeadersAutoreply(),
blackmail.BodyMustText(goatcounter.TplEmailImportError{r.Context(), err}.Render))
if sendErr != nil {
zlog.Error(sendErr)
Expand Down
1 change: 1 addition & 0 deletions handlers/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func (h user) requestReset(w http.ResponseWriter, r *http.Request) error {
T(ctx, "email/reset-user-email-subject|Password reset for %(domain)", site.Domain(ctx)),
blackmail.From("GoatCounter login", goatcounter.Config(ctx).EmailFrom),
blackmail.To(u.Email),
blackmail.HeadersAutoreply(),
blackmail.BodyMustText(goatcounter.TplEmailPasswordReset{ctx, *site, *u}.Render))
if err != nil {
zlog.Errorf("password reset: %s", err)
Expand Down

0 comments on commit 5c678bc

Please sign in to comment.