Help with conditional codes to create nested options

Options

Hi there,

I'm wondering if anyone in the community can help me with the code to nest a conditional option in our email salutations.

We generally use a Dear [First Name], however, this doesn't work for businesses and organizations in our system that are entered with the first name “Company” and last name being the actual name of the business.

I'm wondering if anyone can share code or help me write the code for pulling the last name if first name = company, while also having the option to pull first names for non-businesses, and then using “Friend” if both are empty.

Tagged:

Comments

  • @Gabriela Oh
    Hi, Gabriela. I think this is what you're looking for, but I welcome a sniff test from others:

    [[?XXX::X[[S1:first_name]]X[[S1:last_name]]X::Friend::[[?X[[S1:first_name]]X::XCompanyX::[[S1:last_name]]::[[S1:first_name]]]]]]

    Thanks,
    -Jon

  • @Jon Reich -

    Thanks for your response. I'm having a hard time following. Here's what Luminate Online spits out when you use the conditionals builder.

    <convio:choose>
    <convio:when title="Not Empty" test="nempty" selected="selected">
    <convio:op><convio:session name="1" param="first_name"></convio:session></convio:op>
    <convio:then><convio:session name="1" param="first_name"></convio:session></convio:then>
    </convio:when>
    <convio:otherwise title="Empty">Friend</convio:otherwise>
    </convio:choose>

    Any thoughts on how this could be edited to add the “if first name = company” conditional?

  • Allison King
    Allison King Blackbaud Employee
    Ancient Membership Facilitator 2 Name Dropper Photogenic

    @Gabriela Oh Delete that stuff and just copy in what Jon posted below. The Content Editor will convert it into the code for you. Let us know if that works.

Categories