Webstarters SendGrid
A WordPress-plugin from Webstarters
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/webstarters/sendgrid/archive/refs/heads/master.zipReadme
SendGrid
A WordPress-plugin from Webstarters.
Requirements
- WordPress 5.2
- PHP 7.1
In addition, you must have the necessary credentials to access the SendGrid API.
Installation
You can install the package via Composer:
composer require webstarters/sendgrid
...or download the plugin as a ZIP and upload it via WP-Admin.
Configuration
You must set WS_SENDGRID_API_KEY in your wp-config.php with your SendGrid API Key.
You may set a default SendGrid Template ID for all mails via WS_SENDGRID_DEFAULT_TEMPLATE_ID.
Usage
This plugin overwrites wp_mail to send via SendGrid.
You can also send mail via the new sendgrid_mail method, which extends wp_mail, but adds the possibility of specifying template data and ID.
Example
<?php
$to = 'Peter Jørgensen <pj@webstarters.dk>';
$subject = 'Hello';
$message = 'Hello World!';
$headers = [
'Cc: Peter Jørgensen <pj@webstarters.dk>',
'Bcc: Peter Jørgensen <pj@webstarters.dk>',
'Reply-To: Peter Jørgensen <pj@webstarters.dk>',
];
$attachments = [
'https://via.placeholder.com/1280x720',
];
$templateData = [
'foo' => 'bar',
];
$templateId = 'd-cf81460749c34cd697916aa4760f552c';
$success = sendgrid_mail($to, $subject, $message, $headers, $attachments, $templateData, $templateId);
echo $success;
Debugging
To begin, enable WP_DEBUG and WP_DEBUG_LOG in the wp_config.php file.
Remember to disable WP_DEBUG_DISPLAY if the website is in a production environment.
Security
For any security related issues, send a mail to pj+security@webstarters.dk instead of using the issue tracker.
Credits
About
We are a Digital agency focusing on efficient sparring, efficient process and efficient digital solutions. Just that, pure and precise effect.
When we say Webstarters, that's exactly what we are. And what we do.
Learn more at Webstarters.dk digital marketing bureau.
License
Read the full README on GitHub →
Releases
| Tag | Published |
|---|---|
| 0.1.0 | May 24, 2019 |
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.