CMS Development

dannyjakle
Member

Step-by-step instructions for adding extra RSS feed to email?

SOLVE

Hey guys, I'm at a marketing company and we're trying to send out weekly emails containing posts from two separate blogs. So one email, two RSS feeds. I've made an RSS email and now I'm trying to figure out where to put the HubL markup to add an additional RSS feed. I'm sure this is elementary, but I've been all over the forums and nobody can seem to give me a simple answer. So,

 

1. Where can I put HubL markup in an email? In a custom HTML block?

2. If I'm pulling the RSS feed using the HubL found here, what parameters do I need to edit to pull my correct blog i.e. where do I find my Blog ID and such?

3. Do I need to put in any additional XML/HTML along with the HubL in order to display my feed?

 

Really looking for some hold-my-hand guidance here, I'm new to Hubspot and just trying to get a feel for the mechanics and syntax. I appreciate the help, guys!

0 Upvotes
1 Accepted solution
dannyjakle
Solution
Member

Step-by-step instructions for adding extra RSS feed to email?

SOLVE

@sharonlicari 

 

Here's the code I used inside an HTML block under the existing RSS feed. There's a whole bunch of inline CSS in there to make it match the style of the other RSS feed. That middle section with all the <table> tags was so the photos showed up correctly in emails (a lot of email services don't render "max-width" and other basic CSS elements). Below this code I'll go ahead and post a template.

 

{% set rec_posts = blog_recent_posts('20346648495', 2) %}
{% for rec_post in rec_posts %}
<div style="margin-bottom:10px;"><a class="post-title" href="{{rec_post.url}}" style="font-size:22px;font-weight:600;font-family:'Georgia', serif;text-transform:underline;color:#444444;margin-bottom:10px;">{{rec_post.name}}</a></div>
<div class="post-author-date" style="font-size:15px;font-family:'Georgia', serif;color:#444444;margin-bottom:10px;">By {{rec_post.blog_post_author.display_name}}, {{rec_post.publish_date_localized}}</div>
<span style="color:rgb(68,68,68);font-family:Georgia,serif;"><table width="100%" align="left" class="alignImageTable" style="border:0px currentColor;border-image:none;border-collapse:collapse!important; border-spacing:0!important;mso-table-lspace:0pt;mso-table-rspace:0pt;" cellspacing="0" cellpadding="0"><tbody><tr><td width="100%" align="left" valign="top" style="border:0px currentColor;border-image:none;text-align:left;color:rgb(35,73,109);padding-right:10px;padding-bottom:10px;font-family:Georgia,serif;font-size:15px;border-collapse:collapse;mso-line-height-rule:exactly;" cellpadding="0" cellspacing="0" border="0"><a title="" class="hs-featured-image-link" style="margin:0px;padding:0px;border:0px currentColor;border-image:none;color:rgb(0,164,189);mso-line-height-rule:exactly;" href="{{rec_post.url}}" target="_blank" data-hs-link-id="1"><img width="560" style="margin:0px;padding:0px;border:0px currentColor;border-image:none;width:100%;text-decoration:none;display:block;-ms-interpolation-mode:bicubic;max-width:560px;" src="{{rec_post.featured_image}}" sizes="(max-width:560px) 100vw, 560px" data-filemanager-upsize="true" data-filemanager-upscale="true" data-filemanager-length="560" alt="{{rec_post.featured_image_alt_text}}"/></a></td></tr></tbody></table></span>
<div class="post-body" style="font-size:15px;font-family:'Georgia', serif;color:#444444;margin-bottom:10px;">{{rec_post.post_list_content}}</div>
<div style="margin-bottom:30px;"><a class="post-read-more" href="{{rec_post.url}}" style="font-size:15px;font-family:'Georgia', serif;color:#23a5b0;text-decoration:none;">Read more »</a></div>
{% endfor %}

 

{% set rec_posts = blog_recent_posts('[BLOG ID]', [NUMBER OF POSTS TO DISPLAY]) %}
{% for rec_post in rec_posts %}
<div style=""><a class="post-title" href="{{rec_post.url}}" style="">{{rec_post.name}}</a></div>
<div class="post-author-date" style="">By {{rec_post.blog_post_author.display_name}}, {{rec_post.publish_date_localized}}</div>
<span style=""><table width="100%" align="left" class="alignImageTable" style="border:0px currentColor;border-image:none;border-collapse:collapse!important; border-spacing:0!important;mso-table-lspace:0pt;mso-table-rspace:0pt;" cellspacing="0" cellpadding="0"><tbody><tr><td width="100%" align="left" valign="top" style="border:0px currentColor;border-image:none;text-align:left;padding-right:10px;padding-bottom:10px;border-collapse:collapse;mso-line-height-rule:exactly;" cellpadding="0" cellspacing="0" border="0"><a title="" class="hs-featured-image-link" style="margin:0px;padding:0px;border:0px currentColor;border-image:none;mso-line-height-rule:exactly;" href="{{rec_post.url}}" target="_blank" data-hs-link-id="1"><img width="560" style="margin:0px;padding:0px;border:0px currentColor;border-image:none;width:100%;text-decoration:none;display:block;-ms-interpolation-mode:bicubic;max-width:560px;" src="{{rec_post.featured_image}}" sizes="(max-width:560px) 100vw, 560px" data-filemanager-upsize="true" data-filemanager-upscale="true" data-filemanager-length="560" alt="{{rec_post.featured_image_alt_text}}"/></a></td></tr></tbody></table></span>
<div class="post-body" style="">{{rec_post.post_list_content}}</div>
<div style=""><a class="post-read-more" href="{{rec_post.url}}" style="">Read more »</a></div>
{% endfor %}

 

 

You can find the blog ID by going to your hubspot blog page, and it's in the URL at the part where it says "blog=", for example "blog=20346648495" and that number is your blog ID.

View solution in original post

5 Replies 5
MMorisette
Participant

Step-by-step instructions for adding extra RSS feed to email?

SOLVE

Can you explain how to pull in specific blog topics and exclude the rest?

0 Upvotes
sharonlicari
Community Manager
Community Manager

Step-by-step instructions for adding extra RSS feed to email?

SOLVE

Hey @dannyjakle        

 

I will tag a few of our experts to learn from them. 

 

Hey @Kevin-C  @alyssamwilie @daveroma could you please share your knowledge with @dannyjakle?     

 

Thank you

Sharon


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




dannyjakle
Member

Step-by-step instructions for adding extra RSS feed to email?

SOLVE

@sharonlicari  Actually got it figured out on my own, thanks though!

sharonlicari
Community Manager
Community Manager

Step-by-step instructions for adding extra RSS feed to email?

SOLVE

Hey @dannyjakle 

 

That's great news! It would be great if you could share what you have done to help the community 🙂 

 

Happy Friday!

Sharon


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




dannyjakle
Solution
Member

Step-by-step instructions for adding extra RSS feed to email?

SOLVE

@sharonlicari 

 

Here's the code I used inside an HTML block under the existing RSS feed. There's a whole bunch of inline CSS in there to make it match the style of the other RSS feed. That middle section with all the <table> tags was so the photos showed up correctly in emails (a lot of email services don't render "max-width" and other basic CSS elements). Below this code I'll go ahead and post a template.

 

{% set rec_posts = blog_recent_posts('20346648495', 2) %}
{% for rec_post in rec_posts %}
<div style="margin-bottom:10px;"><a class="post-title" href="{{rec_post.url}}" style="font-size:22px;font-weight:600;font-family:'Georgia', serif;text-transform:underline;color:#444444;margin-bottom:10px;">{{rec_post.name}}</a></div>
<div class="post-author-date" style="font-size:15px;font-family:'Georgia', serif;color:#444444;margin-bottom:10px;">By {{rec_post.blog_post_author.display_name}}, {{rec_post.publish_date_localized}}</div>
<span style="color:rgb(68,68,68);font-family:Georgia,serif;"><table width="100%" align="left" class="alignImageTable" style="border:0px currentColor;border-image:none;border-collapse:collapse!important; border-spacing:0!important;mso-table-lspace:0pt;mso-table-rspace:0pt;" cellspacing="0" cellpadding="0"><tbody><tr><td width="100%" align="left" valign="top" style="border:0px currentColor;border-image:none;text-align:left;color:rgb(35,73,109);padding-right:10px;padding-bottom:10px;font-family:Georgia,serif;font-size:15px;border-collapse:collapse;mso-line-height-rule:exactly;" cellpadding="0" cellspacing="0" border="0"><a title="" class="hs-featured-image-link" style="margin:0px;padding:0px;border:0px currentColor;border-image:none;color:rgb(0,164,189);mso-line-height-rule:exactly;" href="{{rec_post.url}}" target="_blank" data-hs-link-id="1"><img width="560" style="margin:0px;padding:0px;border:0px currentColor;border-image:none;width:100%;text-decoration:none;display:block;-ms-interpolation-mode:bicubic;max-width:560px;" src="{{rec_post.featured_image}}" sizes="(max-width:560px) 100vw, 560px" data-filemanager-upsize="true" data-filemanager-upscale="true" data-filemanager-length="560" alt="{{rec_post.featured_image_alt_text}}"/></a></td></tr></tbody></table></span>
<div class="post-body" style="font-size:15px;font-family:'Georgia', serif;color:#444444;margin-bottom:10px;">{{rec_post.post_list_content}}</div>
<div style="margin-bottom:30px;"><a class="post-read-more" href="{{rec_post.url}}" style="font-size:15px;font-family:'Georgia', serif;color:#23a5b0;text-decoration:none;">Read more »</a></div>
{% endfor %}

 

{% set rec_posts = blog_recent_posts('[BLOG ID]', [NUMBER OF POSTS TO DISPLAY]) %}
{% for rec_post in rec_posts %}
<div style=""><a class="post-title" href="{{rec_post.url}}" style="">{{rec_post.name}}</a></div>
<div class="post-author-date" style="">By {{rec_post.blog_post_author.display_name}}, {{rec_post.publish_date_localized}}</div>
<span style=""><table width="100%" align="left" class="alignImageTable" style="border:0px currentColor;border-image:none;border-collapse:collapse!important; border-spacing:0!important;mso-table-lspace:0pt;mso-table-rspace:0pt;" cellspacing="0" cellpadding="0"><tbody><tr><td width="100%" align="left" valign="top" style="border:0px currentColor;border-image:none;text-align:left;padding-right:10px;padding-bottom:10px;border-collapse:collapse;mso-line-height-rule:exactly;" cellpadding="0" cellspacing="0" border="0"><a title="" class="hs-featured-image-link" style="margin:0px;padding:0px;border:0px currentColor;border-image:none;mso-line-height-rule:exactly;" href="{{rec_post.url}}" target="_blank" data-hs-link-id="1"><img width="560" style="margin:0px;padding:0px;border:0px currentColor;border-image:none;width:100%;text-decoration:none;display:block;-ms-interpolation-mode:bicubic;max-width:560px;" src="{{rec_post.featured_image}}" sizes="(max-width:560px) 100vw, 560px" data-filemanager-upsize="true" data-filemanager-upscale="true" data-filemanager-length="560" alt="{{rec_post.featured_image_alt_text}}"/></a></td></tr></tbody></table></span>
<div class="post-body" style="">{{rec_post.post_list_content}}</div>
<div style=""><a class="post-read-more" href="{{rec_post.url}}" style="">Read more »</a></div>
{% endfor %}

 

 

You can find the blog ID by going to your hubspot blog page, and it's in the URL at the part where it says "blog=", for example "blog=20346648495" and that number is your blog ID.