WordPress.org

Plugin Directory

Test out the new Plugin Directory and let us know what you think.

SendGrid

Send emails and upload contacts through SendGrid from your WordPress installation using SMTP or API integration.

Is there any official documentation for this plugin ?

Yes. You can find it here : https://sendgrid.com/docs/Integrate/Tutorials/WordPress/index.html

What credentials do I need to add on settings page ?

Create a SendGrid account at https://sendgrid.com/partner/wordpress and generate a new API key on https://app.sendgrid.com/settings/api_keys.

How can I define a plugin setting to be used for all sites ?

Add it into your wp-config.php file. Example: define('SENDGRID_API_KEY', 'your_api_key');.

How to use SendGrid with WP Better Emails plugin ?

If you have WP Better Emails plugin installed and you want to use the template defined here instead of the SendGrid template you can add the following code in your functions.php file from your theme:

function use_wpbe_template( $message, $content_type ) {   
    global $wp_better_emails;
    if ( 'text/plain' == $content_type ) {
      $message = $wp_better_emails->process_email_text( $message );
    } else {
      $message = $wp_better_emails->process_email_html( $message );
    }

    return $message;
}
add_filter( 'sendgrid_override_template', 'use_wpbe_template', 10, 2 );

Using the default templates from WP Better Emails will cause all emails to be sent as HTML (i.e. text/html content-type). In order to send emails as plain text (i.e. text/plain content-type) you should remove the HTML Template from WP Better Emails settings page. This is can be done by removing the '%content%' tag from the HTML template.

Why are my emails sent as HTML instead of plain text ?

For a detailed explanation see this page: https://support.sendgrid.com/hc/en-us/articles/200181418-Plain-text-emails-converted-to-HTML

Will contacts from the widget be uploaded to Marketing Campaigns or Legacy Newsletter ?

The contacts will only be uploaded to Marketing Campaigns.

What permissions should my API keys have ?

For the API Key used for sending emails, that is entered on the General tab, the key needs to have Full Access to Mail Send and Read Access to Stats. For the API Key used for contact upload, that is entered on the Subscription Widget tab, the key needs to have Full Access to Marketings Campaigns.

Can I disable the opt-in email ?

No. SendGrid’s Email Policy requires all email addressing being sent to by SendGrid customers be confirmed opt-in addresses.

Can I change the content of the emails before they are sent ?

Yes. You must add a filter that does that. You need to declare a function that takes the content of the email as argument and then call add_filter() with the name "sendgrid_mail_text" or "sendgrid_mail_html", depending on what part of the email you want to change.

If you want to change the text content of all the emails before they are sent you can do it like this :

function change_sendgrid_text_email( $message ) {
    return $message . ' changed by way of text filter ';
}

add_filter( 'sendgrid_mail_text', 'change_sendgrid_text_email' );

If you want to change HTML content of all the emails before they are sent you can do it like this :

function change_sendgrid_html_email( $message ) {
    return $message . ' changed by way of html filter ';
}

add_filter( 'sendgrid_mail_html', 'change_sendgrid_html_email' );

Note that what is changed depends of the content-type that you have set in the settings page or overwritten by way of filter. For "text/plain" only the text part is overwritten by the filter. For "text/html" both the text and the HTML filters are called.

The code snippets above are usually added in the functions.php file of your theme.

Can I use this plugin with BuddyPress ?

Yes. Our plugin required special integration with BuddyPress and it's regularly tested to ensure it behaves as expected. If you have noticed issues caused by installing this plugin along with BuddyPress, you can add the following line to your wp-config.php to disable it :

define('SENDGRID_DISABLE_BUDDYPRESS', '1');

Can I use shortcodes to customize the subscription confirmation page ?

Yes. You need to create custom page and select it from the settings page. You can place any of these shortcodes in the body of that page. Here's an example :

Hi [sendgridSubscriptionFirstName] [sendgridSubscriptionLastName],
Your email address : [sendgridSubscriptionEmail] has been successfully added.
You'll hear from us soon!

You need to enable the use of the First Name and Last Name fields from the settings page in order to use the shortcodes for them.

Does this plugin support Multisite?

Yes. This plugin has basic Multisite support. You need to Network Activate this plugin.

The settings for all sites in the network can be configured only by the Network Admin in the Network Admin Dashboard.

Requires: 4.2 or higher
Compatible up to: 4.7.3
Last Updated: 2 months ago
Active Installs: 50,000+

Ratings

4.5 out of 5 stars

Support

5 of 10 support threads in the last two months have been marked resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1
100,1,1
50,2,1
100,1,1
0,1,0
100,1,1
100,1,1
0,1,0 100,1,1
0,1,0 100,2,2
100,1,1
100,1,1
100,2,2 100,1,1