[feature] Email notifications for new / closed moderation reports (#1628)

* start fiddling about with email sending to allow multiple recipients

* do some fiddling

* notifs working

* notify on closed report

* finishing up

* envparsing

* use strings.ContainsAny
This commit is contained in:
tobi
2023-03-19 13:11:46 +01:00
committed by GitHub
parent 9c55c07be9
commit 7db81cde44
35 changed files with 773 additions and 420 deletions

View File

@@ -35,6 +35,17 @@ type Sender interface {
// SendTestEmail sends a 'testing email sending' style email to the given toAddress, with the given data.
SendTestEmail(toAddress string, data TestData) error
// SendNewReportEmail sends an email notification to the given addresses, letting them
// know that a new report has been created targeting a user on this instance.
//
// It is expected that the toAddresses have already been filtered to ensure that they
// all belong to admins + moderators.
SendNewReportEmail(toAddresses []string, data NewReportData) error
// SendReportClosedEmail sends an email notification to the given address, letting them
// know that a report that they created has been closed / resolved by an admin.
SendReportClosedEmail(toAddress string, data ReportClosedData) error
}
// NewSender returns a new email Sender interface with the given configuration, or an error if something goes wrong.