We recently blogged about our new Dynamic Content feature introduced in the Fall 2009 Release. I'd like to give you a bit more detail on one aspect of Dynamic Content: Dynamic Code.

Just a warning, this blog post will be looking at code. It's simple code, nothing crazy. However, if HTML makes you queasy, then I suggest taking a pass instead.

Whenever you create Dynamic Content within Bronto, we actually insert Dynamic Code into your message. If you feel comfortable around basic coding, such as javascript, then you now have a new tool at your disposal. As you can see above, there are several different elements at play here. We start things out with a dynamic_code block. Everything inside of here will be considered part of this Dynamic Code. This is an area where you have to be careful. Any changes to the basic structure of the code will affect what output people receive. As with any type of code, it's also possible to break Dynamic Code. So please be careful when editing it. Inside a Dynamic Code block you will find some form of conditional, that's the if and later on the else. Bronto also has an elseif available to users. This structure is completed with a closing /if. These are comparable to conditionals available in most other programming languages. In Bronto's Dynamic Code, all of these special terms are enclosed in curly braces - that just makes sure we don't accidentally confuse some of your text for a conditional. Within Dynamic Code, you will enclose any actual content within literal tags. This tells Bronto to view this literally as content, not as Dynamic Code. Inside of those tags, you can have any html you wish. If you are using the WYSIWYG editor you can also click within this area and drop in images, special text, tables, or anything else you need.

So Now what?

Alright, so you understand the basics of how Dynamic Code works. If you play around with the Dynamic Code Wizard, you can check out all the available functions that can be used within an if or elseif. You can then take that code and put it into a template or drop it into a message that you are creating via the API. You may also find that writing the code yourself will provide a bit more flexibility than using the wizard. At the very least, you now have the ability to tweak your Dynamic Content as you go, speeding up any edits you need to make. So try it out.

Don't Forget To Test!

As with any Dynamic Code you create, it's important to check how it looks. Once you have made changes to your Dynamic Code, you should look at the preview. We have added an option in the Fall 2009 Release that allows you to personalize previews to a specific contact. You can select which contacts are available for preview on the individual contact pages. I suggest you select yourself and some other colleagues, then alter your data and list membership in order to see how your content looks with different data. This is also useful for testing out personalization. So check out the new Dynamic Code feature and start delivering a better, more dynamic experience for your contacts.

Adam Covati
Product Manager at Bronto