We should introduce a class to handle processing the form submission from the API. The default processor does nothing with the data received via the API; this task would introduce a class to email address(es) with the data, using the format specified in T344997: Define email content and subject line
Acceptance criteria:
- If configured, ReportIncident will email a list of email addresses with the contents of the incident report form
- The "from" address is configurable
- Unsetting the "to" address configuration disables sending emails
Steps to verify:
- Use MediaWiki-Docker
- Follow steps on https://www.mediawiki.org/wiki/MediaWiki-Docker/Configuration_recipes/Mail_handling to setup a mail server
- Rebuild the docker containers to apply the changes to the docker override file (docker compose down and then docker compose up -d)
- Install the ReportIncident extension
- Add the following to your LocalSettings.php:
$wgReportIncidentRecipientEmails = [ 'test@test.com' ]; $wgReportIncidentEmailFromAddress = 'test@localhost';
- Go to a user talk page
- Click on the "Report" button
- Click through to submit a report
- Fill out the form with test data
- Submit the form
- Load http://localhost:8025/
Check that an email is present at http://localhost:8025/ and the body of the email includes the data you submitted in step 9 and 10.



