How to add post articles to your Gravity Forms email notifications. Ever wanted to add your latest blog articles and posts to an email autoresponder in Gravity forms? We’ll with the below handy little snippet, you can inject your 4 latest blog articles into any default or custom Gravity Forms notification.
Try the live example
Creating short-code
Add the below code snippet to your functions.php file. This snippet registers the shortcode in WordPress and creates the HTML markup that injects your latest posts into a table.
Add the shortcode
Now you’ve created the shortcode to output the 4 latest blog articles, all you need to do is add the following shortcode [email_latest_posts] to any of your Gravity Forms notification emails.
In the example above, I’ve created a custom HTML email, and added the shortcode to it, as below.
The result
The HTML email when sent will render the latest posts and add them into your email like below.
That’s it!
Pretty simple hey? Just add the code snippet to your functions file and you can start adding the shortcode where ever you like!
Make sure to leave a comment below and let us know what you think!