Blog ID, RSS feed email template, multiple RSS feeds in email template

SOLVE
Regular Contributor

Hi all-

 

I'm researching an issue for a potential client, namely, pulling in RSS feeds into an email template.

 

I am new to designing in HubSpot, but not new to troubleshooting tech/entry-level DIY coding.

 

I have been staring at this and this for the past couple of hours, and for the life of me, cannot find  out a couple of things:

1. Is the 'default' value that returns the desired blog return whatever blog is associated with the account you are working in within the design manager?

2. Assuming that the answer to #1 is "yes," I cannot find the ID for the four different blogs the client has sent me. It is actually four different blogs on one site, and I have the URLs. However, from my google sleuthing it appears that I would need to be an admin on the blog account to grab the ID correct? I've tried inspecting elementing, hovering and searching for other ways to grab the blog IDs but failed miserably.

3. If the blogs are hosted on a different site (in this case WordPress) will this HubL code work? Or would separate code be required to display RSS feeds of the most recent blog content?

 

I'm tagging @Gonzalo since your other post would appear to be super helpful if I could figure out the blog ID issue.

 

To anyone who replies, thank you for encouraging me on my path to learning.

Reply
0 Upvotes
5 Accepted solutions

Accepted Solutions
Esteemed Contributor | Gold Partner

First of all, I'm not an expert at explaining things, but I'll give it a go:

 

1 - Content / Content Settings / Marketing / Blog > Templates - you can define which html templates are used for your blog. If you create one template that has to be used over several blogs, the default blog is the blog that you are visiting. You only have to add a blog id if you want to pull in posts from a different blog (a blog which you are not viewing according to the URL)

 

2. You have to be logged in Hubspot, and go Content / Blogs

The URL will change depending on the Blog you clicked to view.

The url should look something like this:

https://app.hubspot.com/blog/XXXX/blogs/YYYY/manage/posts/all

Where YYYY is your blog id.

 

3.  Good question, it really depends what you are implementing. But retrieving an RSS feed from a hubspot blog should be no problem.

 

 

 

 

Esteemed Contributor | Gold Partner
  • You are right, HUBL code will only work on a page/site hosted on Hubspot itself.
  • A Hubspot blog does have an RSS feed and if you use the right plugin or if you're good a programming, you could retrieve several RSS feeds & display them on your own site.
  • You can find your Hubspot RSS feed here:
    https://knowledge.hubspot.com/articles/kcs_article/cos-blog/where-can-i-find-my-hubspot-blog-rss-fee...
  • Pulling in an RSS feed from a different site on Hubspot - That's something I would do with PHP which of course isn't available within hubspot. If you do the research using javascript, I guess this "could" work, but it's probably not the best way to do this. ( https://stackoverflow.com/questions/10943544/how-to-parse-an-rss-feed-using-javascript ). It's not something I would advice if you would like to pull in a whole blog & use paging etc.. could get really complex probably. Also you'd be duplicating data which for SEO reasons it's probably not the best idea Smiley Surprised - However if it's just a few posts you want to show in a sidebar feed or so, why not :-)
Regular Contributor | Platinum Partner

Hey @marianberry,


Sorry for my late response, I am overload of work and didn't had time to invest in the community in the latests months Smiley Happy

 

@benvanlooy is right, you can't use that HubL code because you need the blog hosted in HS. But there is actually a way to read an external blog with this module:
https://designers.hubspot.com/docs/hubl/hubl-supported-modules#rss-listing


With feed_source option you can choose an external RSS (WP has built that functionality and by default its domain.com/feed/ so you can use that to get the info).
The only problem using this block is that you loose some ability to customice the HTML output.

 

I am not sure what are you trying to do, but for some basic widget in the website like latest posts should be good enough! 

Good luck!

 

 

Highlighted
Regular Contributor | Platinum Partner

Hey @marianberry,

If you want to use it in an email it changes the rules of the game Smiley Happy I thought it was in the website Smiley Wink

 

For the email it's even simpler. You need to create a simple template email just to tweak a bit the design to fit the corporate design (but if you want to go deeper you can check the documentation).

Then you need to create a new Email: (Top menu) Content -> Email. Then Create email button -> choose the right template for the new email (here you need to be sure to mark the RSS email type after choosing the email template and before click on create).

Then you will be able to modify the email content. Go to the "Edit Modules sidebar" and click on Main Email Body. There you can add an external RSS link (like the one generated in WP mentioned in other post), the amount of posts to display and in the "item layout/style" you should have an small code like:

<div align="left" style="font-family: {{primary_font}}; color: {{primary_font_color}}; background-color: {{body_color}};">
<h2 style="padding-bottom: 0; margin: 0 0 5px 0;"><span style="font-size: 18px; color: #3366ff;"><a href="{{post.url}}" style="color: #3366ff;">{{post.title}}</a></span></h2>
<p style="padding-top: 0; margin-top: 0;"><span style="color: {{secondary_font_color}};">{{post.author_line}}{{post.publish_date}}</span></p>
{{post.featured_image}}
<div>{{post.summary}}</div>
<p><span style="color: #3366ff;"><a href="{{post.url}}" style="color: #3366ff;">Read more »</a></span></p>
</div>

So you can tweak with some extra inlined CSS or use the content setting to setup the colors (the variables like primary_font_color are related to the content global settings).

 

Good luck!

Regular Contributor

@Gonzalo - THANK YOU!

 

You are an angel! I felt really dumb that the thing I was looking for was a hard coded module in the standard email editor. Robot Frustrated

 

That being said, the client wants to feature four blogs in the one email (i.e. four different RSS feeds), so after a bit of sleuthing, I found this helpful help article with the code to bring in RSS feeds.

 

Here is my sample email (ignore the logo) that I was thinking of showing the client to demonstrate that it will hopefully meet her needs (and before I show her, I plan to pull her logo from her site, style it so it doesn't look stupid but like a decent email, have separation between the four blogs, titles, etc.) One item that didn't work in the code was pulling the images in, so I'll have to see if she absolutely needs that. Essentially this is showing two posts from each blog feed. (image below to demonstrate)

Screen Shot 2018-04-07 at 3.50.05 PM.png

 

This should work don't you think? Thanks for the validation and all of your help!!! Much for me to learn, but I've learned a lot through this process. Thank you again @benvanlooy!

Reply
0 Upvotes
13 Replies 13
Esteemed Contributor | Gold Partner

First of all, I'm not an expert at explaining things, but I'll give it a go:

 

1 - Content / Content Settings / Marketing / Blog > Templates - you can define which html templates are used for your blog. If you create one template that has to be used over several blogs, the default blog is the blog that you are visiting. You only have to add a blog id if you want to pull in posts from a different blog (a blog which you are not viewing according to the URL)

 

2. You have to be logged in Hubspot, and go Content / Blogs

The URL will change depending on the Blog you clicked to view.

The url should look something like this:

https://app.hubspot.com/blog/XXXX/blogs/YYYY/manage/posts/all

Where YYYY is your blog id.

 

3.  Good question, it really depends what you are implementing. But retrieving an RSS feed from a hubspot blog should be no problem.

 

 

 

 

Regular Contributor

@benvanlooy, I'm starting to feel like I should just be responding to you directly, as you appear to be my partner in crime in figuring out my design questions.Robot Very Happy

 

So thank you for responding so thoroughly and thoughfully to my inquiries. I think my job is now to pass it along.

 

Okay, but I think you answered my question. In this case the client wants to feature the most recent posts from her four different blogs hosted on one WordPress site. It sounds like if the blog is not hosted in HubSpot, the default command won't work. Now I'm wondering if HubL would allow to pull in RSS feeds from a blog hosted on a different site or not. She has been advised already that this isn't possible, but me being me, I wanted to confirm for myself.

 

What do you think? Any thoughts?

Reply
0 Upvotes
Esteemed Contributor | Gold Partner
  • You are right, HUBL code will only work on a page/site hosted on Hubspot itself.
  • A Hubspot blog does have an RSS feed and if you use the right plugin or if you're good a programming, you could retrieve several RSS feeds & display them on your own site.
  • You can find your Hubspot RSS feed here:
    https://knowledge.hubspot.com/articles/kcs_article/cos-blog/where-can-i-find-my-hubspot-blog-rss-fee...
  • Pulling in an RSS feed from a different site on Hubspot - That's something I would do with PHP which of course isn't available within hubspot. If you do the research using javascript, I guess this "could" work, but it's probably not the best way to do this. ( https://stackoverflow.com/questions/10943544/how-to-parse-an-rss-feed-using-javascript ). It's not something I would advice if you would like to pull in a whole blog & use paging etc.. could get really complex probably. Also you'd be duplicating data which for SEO reasons it's probably not the best idea Smiley Surprised - However if it's just a few posts you want to show in a sidebar feed or so, why not :-)
Regular Contributor | Platinum Partner

Hey @marianberry,


Sorry for my late response, I am overload of work and didn't had time to invest in the community in the latests months Smiley Happy

 

@benvanlooy is right, you can't use that HubL code because you need the blog hosted in HS. But there is actually a way to read an external blog with this module:
https://designers.hubspot.com/docs/hubl/hubl-supported-modules#rss-listing


With feed_source option you can choose an external RSS (WP has built that functionality and by default its domain.com/feed/ so you can use that to get the info).
The only problem using this block is that you loose some ability to customice the HTML output.

 

I am not sure what are you trying to do, but for some basic widget in the website like latest posts should be good enough! 

Good luck!

 

 

Regular Contributor

@Gonzalo and @benvanlooy - thank you! If this client works with me, I'll owe you both some cash.

 

I completely neglected to mention WHERE the client was hoping to pull in the feeds. She has an existing email template that she pulls in four RSS feeds from her one Wordpress site (i.e. she maintains four different blogs on the site). The email template features the most recent blog posts from those sections which is obviously super easy and convenient for her email and getting this content to her audience.

 

I'll get to checking out the other resources you both sent. Thank you thank you thank you so much!

 

And @Gonzalo you took exactly less than two days to respond to my question, so even with your massive amount of work you are still doing pretty awesome. Thank you!

Regular Contributor

@Gonzalo and @benvanlooy - 

 

I didn't make it clear from my responses yesterday. Do you think everything you wrote out still holds true for an email template?

 

Once one of you confirm or let me know your thoughts, I'll happily be done with this.

Reply
0 Upvotes
Highlighted
Regular Contributor | Platinum Partner

Hey @marianberry,

If you want to use it in an email it changes the rules of the game Smiley Happy I thought it was in the website Smiley Wink

 

For the email it's even simpler. You need to create a simple template email just to tweak a bit the design to fit the corporate design (but if you want to go deeper you can check the documentation).

Then you need to create a new Email: (Top menu) Content -> Email. Then Create email button -> choose the right template for the new email (here you need to be sure to mark the RSS email type after choosing the email template and before click on create).

Then you will be able to modify the email content. Go to the "Edit Modules sidebar" and click on Main Email Body. There you can add an external RSS link (like the one generated in WP mentioned in other post), the amount of posts to display and in the "item layout/style" you should have an small code like:

<div align="left" style="font-family: {{primary_font}}; color: {{primary_font_color}}; background-color: {{body_color}};">
<h2 style="padding-bottom: 0; margin: 0 0 5px 0;"><span style="font-size: 18px; color: #3366ff;"><a href="{{post.url}}" style="color: #3366ff;">{{post.title}}</a></span></h2>
<p style="padding-top: 0; margin-top: 0;"><span style="color: {{secondary_font_color}};">{{post.author_line}}{{post.publish_date}}</span></p>
{{post.featured_image}}
<div>{{post.summary}}</div>
<p><span style="color: #3366ff;"><a href="{{post.url}}" style="color: #3366ff;">Read more »</a></span></p>
</div>

So you can tweak with some extra inlined CSS or use the content setting to setup the colors (the variables like primary_font_color are related to the content global settings).

 

Good luck!

Regular Contributor

@Gonzalo - THANK YOU!

 

You are an angel! I felt really dumb that the thing I was looking for was a hard coded module in the standard email editor. Robot Frustrated

 

That being said, the client wants to feature four blogs in the one email (i.e. four different RSS feeds), so after a bit of sleuthing, I found this helpful help article with the code to bring in RSS feeds.

 

Here is my sample email (ignore the logo) that I was thinking of showing the client to demonstrate that it will hopefully meet her needs (and before I show her, I plan to pull her logo from her site, style it so it doesn't look stupid but like a decent email, have separation between the four blogs, titles, etc.) One item that didn't work in the code was pulling the images in, so I'll have to see if she absolutely needs that. Essentially this is showing two posts from each blog feed. (image below to demonstrate)

Screen Shot 2018-04-07 at 3.50.05 PM.png

 

This should work don't you think? Thanks for the validation and all of your help!!! Much for me to learn, but I've learned a lot through this process. Thank you again @benvanlooy!

Reply
0 Upvotes
Regular Contributor | Platinum Partner

Congrats! That should work fine now.

 

You are right about the featured images, you can not use them if the RSS is external (didn't remember that).


Good luck with your client!

Regular Contributor

Hi @Gonzalo-

 

Thank you for the well wishes. I will certainly keep you in mind as I move forward in my HS career. Smiley Happy

 

Thanks also for the image info, I didn't know that, super helpful.

Reply
0 Upvotes
Regular Contributor

@Gonzalo,

 

Well I landed the job, so I owe you some cash. That being said, I am only in the beginning stages of being able to successfully manipulate code which is super empowering and then at times not so much.

 

The client has a developer that just suggested that I make use of an enclosure tag to grab the images along with the other info for the RSS listing (because apparently all of the feed elements are contained within that tag.)

 

I was told by HS yeterday they use the description tag to pull the RSS info. So my best guess is that the answer is I can't make use of the enclosure tag, unless I had the technical capability to custom write HubL code to create a new RSS listing that would pull from the enclosure tag instead of what their RSS listing module does by default. And I feel I would have no idea how to do that (and it could get really complicated.)

 

Any thoughts? Again thanks so much for any help.

Reply
0 Upvotes
Regular Contributor | Platinum Partner

Congrats @marianberry!


If you come to Inbound18 we can grab some beers/coffee Smiley Wink

 

Regarding the new client request. The only way my team managed that before is building a custom RSS (or editing the default provided by Wordpress) so now you add the featured image inside the description. But as said, then you won't have too much styles to manage there because it will be an image wrapped within the text (you can't go further than float and things like that).

 

I don't work with Wordpress any more so can't help there.

Good luck!

Regular Contributor

You are wonderful @Gonzalo. I really appreciate all of your help on everything.  Keep an eye out on your inbox. Take care.

Reply
0 Upvotes