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

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-599c7aa6e6a47767796157/] The above headers can be added to your custom plugins where you define your own wp_mail...
Read More