# Creating a workflow email pulling blog posts by tag

**URL:** <https://community.hubspot.com/t/creating-a-workflow-email-pulling-blog-posts-by-tag/9937>\
**Category:** CMS Development\
**Created:** [August 22, 2018, 7:26pm UTC](https://community.hubspot.com/t/creating-a-workflow-email-pulling-blog-posts-by-tag/9937 "2018-08-22T19:26:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![egleeson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/egleeson/32/34541_2.png) [@egleeson](https://community.hubspot.com/u/egleeson)\
**Post date:** [August 22, 2018, 7:26pm UTC](https://community.hubspot.com/t/creating-a-workflow-email-pulling-blog-posts-by-tag/9937/1 "2018-08-22T19:26:45Z")

</div>

Hello! I’m at my wits end trying to create an email for a workflow pulling the newest blog posts with a specific tag. I can pull recent posts, but whenever I re-code it to pull by tag, it breaks all the formatting.

Can’t do an RSS email for the RSS feed because it can’t be saved for automation and used in workflows.

Here’s my code. The tag is “technical resources”. Any help/guidance is MUCH appreciated!

```auto
{% set rec_posts = blog_recent_posts('4580349396', 2, tags="technical resources") %}
{% for rec_post in rec_posts %}
<div class="post-box">
<img style="width:100% !important; max-width:100% !important; height:auto !important " src="{{ rec_post.featured_image }}" alt="post-image">
<br>
<br>
<div class="post-content" style="padding-top:15px !important; padding-bottom:25px !important; padding:15px 20px 25px !important; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif">
<h2 style="font-family:Arial, Helvetica, sans-serif !important; width:100% !important; font-weight:700 !important; color:#555555 !important; line-height:24px !important; font-size:22px !important; margin:0 !important; padding:5px 0 15px !important;" class="post-title">{{ rec_post.name }}</h2>
<div class="post-cbyline" style="font-family: Arial, Helvetica, sans-serif; color:#555555 !important">
by <a class="author-link" style="text-decoration:none; color:#555555;" href="{{ group.absolute_url }}/author/{{ rec_post.blog_post_author.slug }}">{{ rec_post.blog_post_author.display_name }}</a>, {{ rec_post.publish_date|datetimeformat('%m/%e/%Y') }}
</div>
<p> {{ rec_post.post_list_content }} </p>
<div class="post-link" style="text-align:center">
<a class="more-link" style=" font-family: Arial, Helvetica, sans-serif !important; background:#0066ff !important; min-width:148px !important; height:40px !important; border-radius:5px !important; line-height:40px !important; text-align:center !important; color:#fff !important; text-transform:uppercase !important; font-weight:700 !important; margin-top:20px !important; display:inline-block !important; text-decoration:none !important; float:none !important; margin-bottom:0 !important; " href="{{rec_post.absolute_url }}"><span style="color:#fff !important;" >Read More</span></a>
</div>

</div> 
</div>
{% endfor %}

```

Thank you!

---

<div class="post-metadata">

**Author:** ![Stephanie-OG](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stephanie-og/32/73267_2.png) [@Stephanie-OG](https://community.hubspot.com/u/Stephanie-OG)\
**Post date:** [August 23, 2018, 12:29pm UTC](https://community.hubspot.com/t/creating-a-workflow-email-pulling-blog-posts-by-tag/9937/2 "2018-08-23T12:29:16Z")

</div>

Hi there!

I’d recommend trying the following to set your recent posts instead:

`{% set rec_posts = blog_recent_topic_posts('4580349396', 'technical resources', 2) %} `

Let me know of that doesn’t work!

* * *

[![|300](https://d2qpr2jzcazej7.cloudfront.net/original/2X/e/e6ddb445b684524bbcbd802044a9ca3919d1fbc7.png)](http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity)HubSpot Design / Development / Automation

[Website](http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity) | [Contact](http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity)

_If this helped, please mark it as the solution to your question, thanks!_

---

<div class="post-metadata">

**Author:** ![egleeson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/egleeson/32/34541_2.png) [@egleeson](https://community.hubspot.com/u/egleeson)\
**Post date:** [August 23, 2018, 5:43pm UTC](https://community.hubspot.com/t/creating-a-workflow-email-pulling-blog-posts-by-tag/9937/3 "2018-08-23T17:43:40Z")

</div>

Thanks for the reply, @Stephanie-OG! That previews as a blank email, though. 😕

---

<div class="post-metadata">

**Author:** ![Stephanie-OG](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stephanie-og/32/73267_2.png) [@Stephanie-OG](https://community.hubspot.com/u/Stephanie-OG)\
**Post date:** [August 23, 2018, 7:46pm UTC](https://community.hubspot.com/t/creating-a-workflow-email-pulling-blog-posts-by-tag/9937/4 "2018-08-23T19:46:36Z")

</div>

That’s strange, it worked on my end when I tested.

The only difference when I tried is that I used ‘default’ instead of the blog ID and my tags are all hyphenated (e.g. ‘custom-module’). I wonder if you need to use a label such as

`'technical-resources'`

instead.

Check out what appears in the topic URL (e.g. mine is ‘[http://www.stephanieogaygarcia.com/blog/topic/\*\*custom-module](http://www.stephanieogaygarcia.com/blog/topic/**custom-module)\*\*’) and try using that instead.

* * *

[![|300](https://d2qpr2jzcazej7.cloudfront.net/original/2X/e/e6ddb445b684524bbcbd802044a9ca3919d1fbc7.png)](http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity)HubSpot Design / Development / Automation

[Website](http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity) | [Contact](http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity)

_If this helped, please mark it as the solution to your question, thanks!_

---

<div class="post-metadata">

**Author:** ![egleeson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/egleeson/32/34541_2.png) [@egleeson](https://community.hubspot.com/u/egleeson)\
**Post date:** [August 24, 2018, 5:48pm UTC](https://community.hubspot.com/t/creating-a-workflow-email-pulling-blog-posts-by-tag/9937/5 "2018-08-24T17:48:50Z")

</div>

Yep, that did it @Stephanie-OG! Thank you so much for your help. I was really hoping it would be a small change like this. 🙂

Thanks!
