In the latest MailChimp upgrade we developed an easy way for you to add a table of contents to your newsletter.
The * | MC:TOC | * dynamic merge tag works by pulling anything from your email that is formatted as Title text, and displaying it as an ordered list complete with bullet points. Each item in your table of contents is then anchor linked to the corresponding blurb in your email.
To add a table of contents to your email, simply insert * | MC:TOC | * where you’d like the contents listing to appear. In the example screen shots you can see that I added some Title text (“In this edition of The MonkeyWrench”), and then added the merge tag below it.
You can also insert a Table of Contents in either the right or left column of a two-column template and the merge tag will work exactly the same way.
(I’ve used extra spaces between the elements of the merge tag so that it will render correctly for those who subscribe to the RSS-to-Email version of the blog.)


I read somewhere that you were going to be offering some nice template designs. When is that planned for?
Hey Russell,
Remove the spaces from * | MC:TOC | * to look like this *|MC:TOC|*, then it works.
I got the same thing when I first inserted to code. Works perfectly now. Thanks MailChimp. Eep.
This is great, I look forward to using this (much easier than trying to update my TOC each week based on what I (fairly capriciously) decide to include.
However, it only seems to work in a side column for me if I also have the tag in the main column as well — otherwise it seems to just render as blank.
We found a small bug, but everything should be working as expected now.
how do i customize the emails? for example i want to insert their first name in the greeting and maybe their mypage in another paragraph…
thanks
tammy
Hi Tammy,
You’d use what we call “merge tags.” When you import a database of subscribers (such as from an Excel spreadsheet), each column of data gets its own merge tag. For example, “First name” might be *|FNAME|*
If you import a spreadsheet with lots of custom fields, like “mypage” or “customerID” then you can specify what each field’s merge tag is named. then, you’d insert that merge tag into your content.
For more info, you might search around http://blog.mailchimp.com/help‘ for “merge tag”
I also just heard that our video guy is working on some merge tag videos over at http://mailchimpacademy.blip.tv/
thank you Ben; I want to learn how to do this to get the most of the mail chimp experience!
Any other suggestions on whatever will drive more traffic to the site are welcome!
Tammy
Amanda – I’m trying to figure out the merge tags.
I want to be able to hyperlink the word “profile” to each members mypage.
what I got using the url: mergetag was the entire string http://www.blabla.cm/bla/bla/bla when I sent the actual email.
How do i fix the problem where it will hyperlink the word “profile” to their page, without it displaying the page address?
Thanks
Tammy
We are having a simular issue. The TOC works great, but only seems to pull titles from the main body and not the side column. How can the TOC include both?
So, how do I know what HTML this is going to generate? I’d like to make sure the output is styled correctly with my CSS.
For me, I dropped the code into the top of the content area, and clicked the preview link. It fit for my set-up.
Great feature. I’m trying to implement this feature in our newsletter and can’t get it to render. I’m using “*|MC:TOC|*” in a tag. Any ideas?
I used it in my sidebar column, and it was wonderful! Even took the longer titles… which prompted me to shorten them.
However, it quit before including the sixth title. I took it as a stylistic comment, but it might be a bug.
This is a great feature, but there are a couple of things that would make it even more useful for me:
-if a title is long enough that it wraps to the next row, another bullet point is added. I don’t see any way to prevent this from occurring.
-Would like to see some options about the style of the bullets – i.e. using dashes instead of points
Thanks!
Every time I log on I find you’ve added some new cool feature
This one will be a real timesaver – thanks!
Just won’t render for me. Are there any common mistakes I might be making?
I’m using it in a RSS campaign, along with:
*|RSSITEMS:|*
*|RSSITEM:TITLE|*
*|RSSITEM:CONTENT|*
comment | *|RSSITEM:DATE|*
*|END:RSSITEMS|*
Okay I figured it out. You actually have to select *|RSSITEM:TITLE|* and then apply the Title style to it in the editor.
This is great! Thanks. It would be even nicer if there were a way to style the .
The generated code “” has a CSS style associated with it. Is there any way to override the style in a template?
Why do I get a blank bullet point in my rss feed? Can I remove that? Also, the first link in my rss feed is the actual title of my wordpress blog. I do not wish to have the title of my blog appear within the TOC tag. Please advise ASAP.
Not sure. Our support team might be able to help you diagnose, if you send them your feed and your campaign where the blank bullet appeared. Off the top of my head, my only guess would be that somewhere in your email campaign, you’ve got an empty “TITLE” tag. The TOC feature generates bullet points for titles.
Do you mean the title of your feed is being turned into a TOC entry? The TOC looks for things tagged as “titles” so my guess is that you have your RSS feed’s title somewhere in the content, and it’s tagged as a title. You could change the tags around it to just be large fonts if you want the TOC to ignore it. If that’s not it, definitely contact our support team. I’m just a pretty face around here.
I’m trying to use this tag. I’m confused. Is this tag insert into the template code? Or is it a campaign tag?
I tried inserting into my template code, and it only displays as regular text…
This is what I have in the template file:
*|MC:TOC|*
How do I make this work?
Is there content in your campaign yet? If you’re just coding it into a template, I’d save the template then make a test campaign with real content.
It doesn’t render a table of contents until you have content in the campaign, and the content would need some titles/headlines for the TOC to pick them up and render. Hope that makes sense. If that doesn’t work, contact our support team to diagnose: mailchimp.com/help/
Has anyone fixed the inline styling issue with mc:toc?
Hey, I’m also interested in knowing if there is a way to style the TOC lists. I know that it can be done with an inline style sheet, but everyone says that you shouldn’t reply on those.
This of course makes styling the TOC impossible as it’s generated after the UL styles have been stripped.
Scratching my head a lot – I can’t think of any other way to do it
Chris
Inline CSS is much more reliable than embedded CSS.
Are you using TOC in RSS-generated emails, or manually written HTML emails? This TOC tag is a nice timesaver, but if you’re writing occasional email newsletters, you can always use old-fashioned, hand-coded anchor links (and use inline CSS to customize them).
Ben,
Hand-Coding? Really? That’s your solution?
We know this is a difficult problem, but as you can see a number of your customers are asking for this.
I write a weekly newsletter as well as a RSS generated one and I love the idea of Table Of Contents at the top, but I can’t fathom the time necessary to “hand-code” it each week.
Is this really the only solution your offering?
Yeah sorry, but that’s why I asked if it was an RSS-based email (autogenerated) or an infrequent email that’s hand-coded. If the former, my advice isn’t feasible. If the latter, hand-coding anchor links is really not that hard (especially for people who would hand-code CSS styles for the TOC). There’s even a really nifty anchor link button there in the editor:
I do think this is worth doing properly.
I’m a huge fan of both Mail Chimp and Campaign monitor, as they each have their strengths.
For example CM have got around this problem by allowing developers to add the following code to their templates.
A very simple solution – their TOC elements are generated naked. ie they don’t have the UL and LI so you can wrap them in what ever you want.
This means that pure inline styling is possible. Would it really be that hard to change the TOC snippet so that it doesn’t output the UL and LI?
Cheers
Chris
Sorry, my code example was stripped from the comment above. Should have looked like…
(ul)
(tableofcontents)
(li)
($repeatertitle$)
(/li)
(/tableofcontents)
(/ul)
I had to use brackets to get it to work….
I agree, this would be perfect. As it is now, it doesn’t give the template developer any freedom to customize the look of the table of contents. Now I am trying to figure out what to tell the client… maybe I’ll tell them to switch to Campaign Monitor?
Or if it’s too hard give a couple of pre styled inline versions of the table of contents.
one with bullet points and one without (no indenting).
Just curious – has anyone figured out a resolution for this? Is everyone just hand-coding the links in order to style the TOC? I must be missing something because otherwise, this MC:TOC tag seems pretty worthless.
If Hand Coding were an option, we wouldn’t be asking for this. It seems rather simple on the face of it but I can only guess this is too difficult to code.
I guess we’re not big enough customers.
I agree with teh previous comment that a range of options for TOC auto-population would be fantastic as a stopgap measure. The main issue that I have been having is that the bullets are indenting significantly meaning most of my titles are going onto two lines, even when they are quite short (I am using one column of a three column layout for my navigation)
I am setting this up for my team who don’t do “IT”, so it needs it to be automatic. There may be an easy fix for this – I hope there is – But I can’t find it…
Apart from that – our template is looking perfect!