擴展:SendGrid
[[Special:MyLanguage/Extension status| |
|
|---|---|
| 实现 | 通知 |
| 描述 | Enables MediaWiki to use the SendGrid API for email distribution. |
| 作者 | Derick Alangi (X-Savitar留言) |
| 最新版本 | 4.0 |
| 兼容性政策 | 快照跟随MediaWiki发布。 master分支不向后兼容。 |
| MediaWiki | 1.40+ |
| PHP | 7.4+ |
| Composer | sendgrid/sendgrid |
|
|
| 许可证 | GNU General Public License 2.0 or later |
| 下載 | README |
| 前往translatewiki.net翻譯SendGrid扩展 | |
| 問題 | 开启的任务 · 报告错误 |
The SendGrid extension enables MediaWiki to send emails through SendGrid's API service.
安裝
- 下载文件,并解压
SendGrid文件夹到extensions/目录中。
开发者和代码贡献人员应改从Git安装此扩展,输入:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SendGrid
- 請新增下列代码到您的LocalSettings.php文件的底部:
wfLoadExtension( 'SendGrid' );
完成 – 請导航至您的wiki上的Special:Version,以验证此扩展已成功安装。
使用Vagrant安装:
- 如果你有使用Vagrant,请通过
vagrant roles enable sendgrid --provision安装
composer update in extensions/SendGrid/ folder so that composer can pick up and install the required SendGrid dependencies for the extension to run smoothly.Configuration
You need to have an account on www.sendgrid.com and a valid API key to successfully send emails via SendGrid using this extension.
Instructions to generate an API key can be found in the SendGrid API key documentation.
SendGrid/extension.json as this will be a vulnerability allowing someone else to be able to use your account/key to send emails or perform other bad stuff.In your SendGrid account settings, generate an API key. With a valid API Key, configure your API key in LocalSettings.php:
$wgSendGridAPIKey = "YOUR_API_KEY_HERE";
If you're using this extension with SMTP, make sure to configure your SMTP as follows:
$wgSMTP = [
'host'=> "smtp.yoursmtp.org",
'IDHost' => "yourhost.org",
'port' => 587,
'auth' => true,
'username' => "yourSMTPusername",
'password' => "yourSMTPpassword"
];
測試你的設定
Go to Special:EmailUser and send an email to your own address to verify that the extension is working. You'll receive an email from the address you input and check to see if it's sent via the SendGrid API, for example, Your Name example@domain.com via sendgrid.net .
Errors or exceptions
If your email fails to send and throws an exception, make sure that $wgPasswordSender matches the email sender identifier used in your SendGrid account.
Notice the change here: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/SendGrid/+/833121
