- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Blog ID, RSS feed email template, multiple RSS feeds in email template
SOLVEApr 2, 2018 5:55 PM - edited Apr 7, 2018 6:53 PM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Accepted Solutions
Apr 3, 2018 9:15 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Apr 4, 2018 3:07 AM
- 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 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Apr 4, 2018 7:15 AM - edited Apr 4, 2018 7:19 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Apr 6, 2018 6:26 AM - edited Apr 6, 2018 6:27 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Apr 7, 2018 6:51 PM - edited Apr 9, 2018 2:38 PM
@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.
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)
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content