Extension:SendGrid

From MediaWiki.org
Jump to navigation Jump to search

Other languages:
English • ‎dansk • ‎español • ‎français • ‎svenska • ‎中文 • ‎日本語
MediaWiki extensions manual
Crystal Clear action run.svg
SendGrid
Release status: stable
Implementation Notify
Description Enables MediaWiki to use the SendGrid API for email distribution.
Author(s) Derick N. Alangi (X-Savitartalk)
Latest version 2.1 (2018-10-20)
Compatibility policy master
MediaWiki 1.31+
PHP 7.0+
Database changes No
Composer sendgrid/sendgrid
License GNU General Public License 2.0 or later
Download
README
Hooks used
AlternateUserMailer
Translate the SendGrid extension if it is available at translatewiki.net
Check usage and version matrix.
Issues Open tasks · Report a bug

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

Installation[edit]

  • Download and place the file(s) in a directory called SendGrid in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'SendGrid' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension() If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'SendGrid' );, you need to use:

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[edit]

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.

Warning Warning: Security Warning: Do not paste your SendGrid keys directly in your SendGrid/extension.json as this will be a vulnerability making someone else to be able to use your account to send emails or perform other bad stuff.

Configuration on MediaWiki-Vagrant[edit]

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[edit]

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 ).