CMS Development

marianberry
Contributor

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

SOLVE

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.

0 Upvotes
5 Accepted solutions
benvanlooy
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

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

SOLVE

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.

 

 

 

 

View solution in original post

benvanlooy
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

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

SOLVE
  • 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 😮 - However if it's just a few posts you want to show in a sidebar feed or so, why not 🙂

View solution in original post

Gonzalo
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

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

SOLVE

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 🙂

 

@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!

 

 

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting

View solution in original post

Gonzalo
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

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

SOLVE

Hey @marianberry,

If you want to use it in an email it changes the rules of the game 🙂 I thought it was in the website 😉

 

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!

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting

View solution in original post

marianberry
Solution
Contributor

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

SOLVE

@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!

View solution in original post

0 Upvotes
13 Replies 13
benvanlooy
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

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

SOLVE

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.

 

 

 

 

marianberry
Contributor

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

SOLVE

@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?

0 Upvotes
benvanlooy
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

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

SOLVE
  • 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 😮 - However if it's just a few posts you want to show in a sidebar feed or so, why not 🙂
Gonzalo
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

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

SOLVE

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 🙂

 

@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!

 

 

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting
marianberry
Contributor

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

SOLVE

@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!

marianberry
Contributor

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

SOLVE

@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.

0 Upvotes
Gonzalo
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

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

SOLVE

Hey @marianberry,

If you want to use it in an email it changes the rules of the game 🙂 I thought it was in the website 😉

 

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!

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting
marianberry
Solution
Contributor

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

SOLVE

@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!

0 Upvotes
Gonzalo
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

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

SOLVE

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!

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting
marianberry
Contributor

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

SOLVE

Hi @Gonzalo-

 

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

 

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

0 Upvotes
marianberry
Contributor

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

SOLVE

@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.

0 Upvotes
Gonzalo
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

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

SOLVE

Congrats @marianberry!


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

 

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!

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting
marianberry
Contributor

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

SOLVE

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

0 Upvotes