expand the support for conditionals to include API tags
For instance, if I have a message field defined in code as follows:
List<MessageFieldObject> fields = new ArrayList<MessageFieldObject>();
// add message fields
MessageFieldObject field = of.createMessageFieldObject();
field.setType("html");
field.setName("foo");
field.setContent("hello");
fields.add(field);
in my message template, I would like to be able to use the field as such:
{dynamic_code}
{if $#foo neq ""}%%#foo%%{/if}
{/dynamic_code}

Greetings all,
The good news here is that the functionality to use dynamic code to evaluate API message tags had always existed. The bad news is that it was not properly documented.
We sincerely apologize for the confusion. This is now properly documented here: https://helpdocs.bronto.com/bmp/concept/c_bmp_messages_dynamic_code_conditional_expressions.html
All best,
Eric @ Bronto
5 comments
-
Justin Hammer commented
We are looking for this too. In addition, would like to to use Brontos native date functions/calculations as conditional for dynamic content.
-
Steve Wages commented
We need this as well. Easily figured out how to do suppression of fields within HTML for Bronto variables, but was dismayed to find out you can't do this with variables passed via API.
-
David commented
Our team would also like to be able to use conditional logic on these fields. We're utilizing your Bronto extension, which is setting several fields which we can use for display. We aren't able to use the values in conditional tags, though.
-
Kara Sheil commented
I think this is exactly the functionality that we are looking for as well. Question to Bronto Support: Is there a plan for the future for us to be able to evaluate our custom variables within an email to create the if/then scenarios? It seems you can with Bronto's static variables.
We were looking for a way to compare the values of two custom variables, and if they were equal, then display a certain graphic on the page, if not equal display a different graphic. The answer received from support was "We unfortunately do not have the ability to compare two different fields to see if they match. Your best option would be to code this logic on your end while using the API to pull the field values, compare them and decide what content you should populate back to an API triggered delivery in order to populate API Message Tags.
Otherwise you'd have to use our Dynamic Content feature in conjunction with segments. But, even then, with segments, you would only be able to compare one specific date value per segment (not ideal) or compare date values with things like date is 'TODAY', or 'YESTERDAY' for example, which would probably not work in your situation.
For now we handled this externally from the template which hurts our marketing team and the transactional email templates lose their power. Now if they want a change it is a request to the development team for the code feeding the template and not just a more simple template change directly.
If this is a separate issue from what Sean initially requested back in 2011, then let me know and I will start a new post.
-
Joe commented
As a programmer, I want to send the most amount of data to my marketing group so they can use it any way they see fit. Currently, with API tags, if I send them a blank tag, there is no programmatic way to suppress blank api tags in the message. So they can't hide the text that would surround the API tag where I, for instance, send the size, even though not all products have size.