Sendgrid Contacts API  Examples

Sendgrid Contacts API Examples

If you are using Sendgrid to send your Marketing / Promotional emails then using the Sendgrid Contacts API can automate quite a few things for you. Here are some simple API examples to add/remove/edit recipients to the Sendgrid Contacts Database and synchronising the Sendgrid lists with the Wordpress mailing lists. There are 2 ways to synchronise your mailing lists in wordpress with the Sendgrid lists. One is using the daily/weekly cron job and the other is through real time i.e. an on demand system. Obviously we all would prefer the real time system. However it largely depends on how you handle your subscription process in Wordpress. If you have created your own subscription system then you are either storing the contacts in your own table or you are using the Wordpress usermeta table. API can be called by making the necessary changes in your system. Synchronisation of the mailing lists in that case can be done in real time. If you are using some plugin...
Read More

Prevent your emails going to spam/junk

Emails going to spam folder can be a sticky issue and generally there is no simple way to fix the problem. If you are already facing this issue then either your domain is blacklisted somewhere or you may just be missing a few simple tricks. In any case a preliminary check should be to check if your sending domain or your IP is blacklisted. This would be a preliminary check because if you are already blacklisted then no matter what efforts you make to fix other things your emails will still end up going to spam / junk folder. Check if your site is blacklisted using below tools by adding your site domain or IP address. If you are using cloudflare then try both i.e. your site domain and then your site IP address. This is because if you are using cloudflare, a domain check may not resolve to the true IP of your site. If your site is blacklisted you will need to request to have...
Read More

How to apply Sendgrid categories to WordPress emails

What are Sendgrid Email Categories Creating categories for different kinds of emails sent through sendgrid is quite beneficial. It allows you to track emails based on each category i.e. it allows you to tag your emails by topics. e.g. it would be nice to know how many user registration emails actually were delivered, how many people requested password resets, etc For instance emails sent through wordpress can be categorised as User Registration Password Reset Newsletter, etc How to add Sendgrid categories As per the sendgrid documentation You can add categories to the X-SMTPAPI header of the emails you send via SendGrid. This will allow you to track emails based on your own categorization system. In case of wordpress emails here are the steps to follow Install the Wordpress Sengrid plugin: Since the version 1.6.9 this plugin allows to add categories in the email headers. add the category headers to the wp_mail function as shown below How to add category headers to the wp_mail function [crayon-599c7a93edea3044840067/] The above headers can be added to your custom plugins where you define your own wp_mail...
Read More