Jump to content

Extension:SendGrid

From mediawiki.org
This page is a translated version of the page Extension:SendGrid and the translation is 18% complete.
Manuel des extensions MediaWiki
SendGrid
État de la version : stable
Implémentation Notifier
Description Enables MediaWiki to use the SendGrid API for email distribution.
Auteur(s) Derick Alangi (X-Savitardiscussion)
Dernière version 4.0
Politique de compatibilité Versions ponctuelles alignées avec MediaWiki. Le master n'est pas compatible arrière.
MediaWiki 1.40+
PHP 7.4+
Composer sendgrid/sendgrid
Licence Licence publique générale GNU v2.0 ou supérieur
Téléchargement
README
  • $wgSendGridAPIKey
Traduire l’extension SendGrid sur translatewiki.net si elle y est disponible
Problèmes Tâches ouvertes · Signaler un bogue

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

Installation

  • Téléchargez et placez le(s) fichier(s) dans un répertoire appelé SendGrid dans votre dossier extensions/.
    Les développeurs et les contributeurs au code doivent à la place installer l'extension à partir de Git en utilisant:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SendGrid
    
  • Ajoutez le code suivant à la fin de votre fichier LocalSettings.php  :
    wfLoadExtension( 'SendGrid' );
    
  • Yes Fait – Accédez à Special:Version sur votre wiki pour vérifier que l'extension a bien été installée.


Installer Vagrant :

  • Si vous utilisez Vagrant , installez avec vagrant roles enable sendgrid --provision
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 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.

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

Testez vos paramètres

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