Open main menu

Extension:SendGrid/zh

This page is a translated version of the page Extension:SendGrid and the translation is 0% complete.
Other languages:
English • ‎español • ‎français • ‎svenska • ‎中文 • ‎日本語
MediaWiki扩展手册
OOjs UI icon advanced.svg
SendGrid
发布状态: 稳定版
实现 通知
描述 Enables MediaWiki to use the SendGrid API for email distribution.
作者 Derick Alangi (X-Savitartalk)
最新版本 2.2 (2019-04-28)
兼容性方针 主线(master)
MediaWiki 1.33+
PHP 5.6+
数据庫更新
Composer sendgrid/sendgrid
许可协议 GNU通用公眾授權條款2.0 or later
下载
README
翻译SendGrid扩展如果在translatewiki.net可用
检查使用和版本矩阵。
问题 开放的工作 · 报告错误

The SendGrid extension enables MediaWiki to send emails through SendGrid's API service.

Installation

  • 下载文件,并将其放置在您extensions/文件夹中的SendGrid目录内。
  • 将下列代码放置在您的LocalSettings.php的底部:
    wfLoadExtension( 'SendGrid' );
    
  •   完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

致使用MediaWiki 1.24或更早版本的用户:

上面的说明介绍的是安装此扩展的新方法,它使用wfLoadExtension()。 如果您需要在早期版本(MediaWiki 1.24和更早版本)中安装此扩展,而不是wfLoadExtension( 'SendGrid' );,您需要使用:

require_once "$IP/extensions/SendGrid/SendGrid.php";
You will have to run 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 in order to successfully send emails via SendGrid using this extension. Instructions to generate an API key can be found in the SendGrid API key documentation.

  警告: Security Warning: Do not put your SendGrid API key directly in the 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.

Configuration on MediaWiki-Vagrant

Once your MediaWiki-Vagrant environment is setup correctly, do the following to get SendGrid to work properly with your new environment;

  • On your terminal, run: vagrant roles enable sendgrid.

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";

Test your settings

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 inputed and check to see if it's sent via the SendGrid API (for example; Your Name example@domain.com via sendgrid.net ).