Extension:Resend
Appearance
Release status: stable |
|
|---|---|
| Implementation | other (invalid type) |
| Description | Sends MediaWiki user emails through the Resend API instead of the default mail transport. |
| Author(s) | jmnote |
| Latest version | 0.1.1 |
| MediaWiki | 1.43+ |
| Composer | resend/resend-php |
| Licence | Apache License 2.0 |
| Download | GitHub:
Note: |
The Resend extension enables MediaWiki to send emails using the Resend API service.
This is an alternative to the default PHP mailer or SMTP, providing a modern API-based delivery method that keeps your email infrastructure decoupled from your web host.
Installation
[edit]1. Download the extension and place it in your extensions/ folder:
cd extensions/
git clone --depth 1 https://github.com/jmnote/Resend.git
2. This extension requires the Resend PHP SDK. Create or update composer.local.json in your MediaWiki root directory:
{
"extra": {
"merge-plugin": {
"include": [
"extensions/*/composer.json"
]
}
}
}
3. Run composer update from your MediaWiki root:
composer update --no-dev
4. Add the following to your LocalSettings.php:
wfLoadExtension( 'Resend' );
$wgResendAPIKey = 're_xxxxxxxxxxxxxxxxx';
Configuration
[edit]Parameters
[edit]| Variable | Default | Description |
|---|---|---|
$wgResendAPIKey |
null |
Your Resend API key (starts with re_). You can obtain this from the Resend Dashboard.
|
How it works
[edit]The extension utilizes the AlternateUserMailer hook:
- If
$wgResendAPIKeyis configured, it intercepts the mail delivery and sends the payload to the Resend API. - If the API delivery is successful, it returns
falseto the hook to prevent MediaWiki's default mailer from sending a duplicate. - If the API key is missing or the delivery fails, it will log an error.
Troubleshooting
[edit]- Sender Identity: Ensure that the email address defined in
$wgPasswordSender(or$wgEmergencyContact) is verified in your Resend dashboard. - Dependencies: If you encounter a
Class "Resend\Client" not founderror, verify thatcomposer updatewas executed successfully in the MediaWiki root.
