Complex Salutation stags statement

Options

Hi,

 

I am trying to create a complex salutation with stags. I need a stags statement that fills in a nickname and a spouse nickname. For example:

 

#1 Dear "Jonathan and Diana",

#2 Dear "Jonathan",

 

The stags statement nees to pull in a user's nickname and also their significant other's nickname (#1) into the salutation. The statement needs to be smart enough to know that if a significant other nickname is not available, then just output the users nickname (#2).

 

So far, I have written this:

 

[[?

 

[[?[[Nickname]]::TRUE

:: [[?[[Spouse Nickname]]::TRUE

   ::Nickname and Spouse Nickname

   ::

   ]]

::Nickname

]]

 

Does this look right? Also, does anyone know what the stags field is for Nickname and Spouse Nickname?

 

Many thanks,

Jonathan

 

]]

 

 

Tagged:

Comments

  • Kent Gilliam
    Kent Gilliam Blackbaud Employee
    Ancient Membership 2500 Comments 100 Likes Name Dropper

    Try this. I don't have a DB with spouse info to test against but I think this will work. The "And spouse info" has me a bit perplexed but I'm sending this around to see if I can get a code check.

     


    For Primary Record:

    [[?xx::x[[S1:nickname]]x::[[?xx::x[[S1:first_name]]x::Friend::[[S1:first_name]]]]::[[S1:nickname]]]]

    For Spouse Record:

    [[?xx::x[[S1:so_nickname]]x::and [[?xx::x[[S1:so_first_name]]x::::[[S1:so_first_name]]]]::[[S1:so_nickname]]]]

    You basically should be able to put these into your editor like such:

     


    [[?xx::x[[S1:nickname]]x::[[?xx::x[[S1:first_name]]x::Friend::[[S1:first_name]]]]::[[S1:nickname]]]] [[?xx::x[[S1:so_nickname]]x::and [[?xx::x[[S1:so_first_name]]x::::[[S1:so_first_name]]]]::[[S1:so_nickname]]]]

     

     

  • Kent Gilliam:

    Try this. I don't have a DB with spouse info to test against but I think this will work. The "And spouse info" has me a bit perplexed but I'm sending this around to see if I can get a code check.

     


    For Primary Record:

    [[?xx::x[[S1:nickname]]x::[[?xx::x[[S1:first_name]]x::Friend::[[S1:first_name]]]]::[[S1:nickname]]]]

    For Spouse Record:

    [[?xx::x[[S1:so_nickname]]x::and [[?xx::x[[S1:so_first_name]]x::::[[S1:so_first_name]]]]::[[S1:so_nickname]]]]

    You basically should be able to put these into your editor like such:

     


    [[?xx::x[[S1:nickname]]x::[[?xx::x[[S1:first_name]]x::Friend::[[S1:first_name]]]]::[[S1:nickname]]]] [[?xx::x[[S1:so_nickname]]x::and [[?xx::x[[S1:so_first_name]]x::::[[S1:so_first_name]]]]::[[S1:so_nickname]]]]

     

     

    Hi Kent,

     

    Thanks for the conditionals. I have made a few changes to make it work as expected:

     

    Dear

    [[?xx::x[[S1:nickname]]x::[[?xx::x[[S1:first_name]]x::Friend::[[S1:first_name]]]]::[[S1:nickname]]]]

    [[?xx::x[[S1:so_nickname]]x::[[?xx::x[[S1:so_first_name]]x::::[[S1:so_first_name]]]]:: and [[S1:so_nickname]]]],

     

    The result gets either:

     

    Dear Nickname,

    OR

    Dear Nickname and SO-Nickname,

     

    The changes I made were:

    • Removed the first "and" in the SO-Nickname conditional and moved it to the last part of the conditional.
    • Removed the space between the two conditionals and added the space to the second conditional in front of the "and".

    Also, I made an alt version to the conditional for the SO-Nickname:

     

    [[?xx::x[[S1:so_nickname]]x:::: and [[S1:so_nickname]]]]

     

    This seems to work the same as the altered version of your conditional. Because I don't have access to the Significant Other First Name, would my alt version be better to use?

     

    Many thanks,

    Jonathan

     

     

  • Kent Gilliam
    Kent Gilliam Blackbaud Employee
    Ancient Membership 2500 Comments 100 Likes Name Dropper
    Jonathan Kapaldo:

    Hi Kent,

     

    Thanks for the conditionals. I have made a few changes to make it work as expected:

     

    Dear

    [[?xx::x[[S1:nickname]]x::[[?xx::x[[S1:first_name]]x::Friend::[[S1:first_name]]]]::[[S1:nickname]]]]

    [[?xx::x[[S1:so_nickname]]x::[[?xx::x[[S1:so_first_name]]x::::[[S1:so_first_name]]]]:: and [[S1:so_nickname]]]],

     

    The result gets either:

     

    Dear Nickname,

    OR

    Dear Nickname and SO-Nickname,

     

    The changes I made were:

    • Removed the first "and" in the SO-Nickname conditional and moved it to the last part of the conditional.
    • Removed the space between the two conditionals and added the space to the second conditional in front of the "and".

    Also, I made an alt version to the conditional for the SO-Nickname:

     

    [[?xx::x[[S1:so_nickname]]x:::: and [[S1:so_nickname]]]]

     

    This seems to work the same as the altered version of your conditional. Because I don't have access to the Significant Other First Name, would my alt version be better to use?

     

    Many thanks,

    Jonathan

     

     

    Your alt version would work as long as you have a nickname for every record. Otherwise I would make sure to add the "first_name" test if nickname is empty. Also, if you don't have nickname OR first_name then your salutation will read "Dear         ". If you're not confident you have info for everyone you'll definitely want a "Friend" line in there so there won't be a blanks space.

  • Kent Gilliam:

    Your alt version would work as long as you have a nickname for every record. Otherwise I would make sure to add the "first_name" test if nickname is empty. Also, if you don't have nickname OR first_name then your salutation will read "Dear         ". If you're not confident you have info for everyone you'll definitely want a "Friend" line in there so there won't be a blanks space.

    Hi, I'm fairly new to Luminate Online and the code above isn't working at all when I paste and save it in an email.

     

     

    I'm trying to achieve this:

     

    if first_name and so_first_name is not empty, then first_name and so_first_name



    else if first_name is not empty, then first_name



    else if first_name is empty, then Carter Center Partner

     

     

    If you can provide any help, I would really appreciate it!!!

     

    Thanks,

    Kerry

  • Kerry Meyers:

    Hi, I'm fairly new to Luminate Online and the code above isn't working at all when I paste and save it in an email.

     

     

    I'm trying to achieve this:

     

    if first_name and so_first_name is not empty, then first_name and so_first_name



    else if first_name is not empty, then first_name



    else if first_name is empty, then Carter Center Partner

     

     

    If you can provide any help, I would really appreciate it!!!

     

    Thanks,

    Kerry

    Hey Kerry,

     

    Not sure if you still need this but try this:

     


    [[?xx::x[[S1:first_name]]x::
    Carter Center Partner
    ::
    [[S1:first_name]]
    ]]

    The "x"s are delimeters put around items or part of items you want to check for. In this case by putting two next to each other like this "xx" we are checking for blank. So this statement would read: If first name contains blank, then print Carter Center Partner else print first name.

  • Ken Cantu:

    Hey Kerry,

     

    Not sure if you still need this but try this:

     


    [[?xx::x[[S1:first_name]]x::
    Carter Center Partner
    ::
    [[S1:first_name]]
    ]]

    The "x"s are delimeters put around items or part of items you want to check for. In this case by putting two next to each other like this "xx" we are checking for blank. So this statement would read: If first name contains blank, then print Carter Center Partner else print first name.

    Ken, thank you. I figured it out a while back but with the XML-based tags.

     


    <convio:choose>



    <convio:when title="Not empty" test="nempty" selected="selected">

    <convio:smileysurprised:p><convio:session name="1" param="first_name"></convio:session></convio:smileysurprised:p>

    <convio:smileysurprised:p><convio:session name="1" param="so_first_name"></convio:session></convio:smileysurprised:p>

    <convio:then><convio:session name="1" param="first_name"></convio:session> and <convio:session name="1" param="so_first_name"></convio:session>,</convio:then>

    </convio:when>



    <convio:when title="Not empty" test="nempty">

    <convio:smileysurprised:p><convio:session name="1" param="first_name"></convio:session>,</convio:smileysurprised:p>

    <convio:then>



    <convio:choose>

    <convio:when title="Not empty" test="nempty" selected="selected">

    <convio:smileysurprised:p><convio:session name="1" param="first_name"></convio:session></convio:smileysurprised:p>

    <convio:then><convio:session name="1" param="first_name"></convio:session></convio:then>

    </convio:when>

    <convio:smileysurprised:therwise title="Empty">Carter Center Partner</convio:smileysurprised:therwise>

    </convio:choose>,



    </convio:then>

    </convio:when>



    </convio:choose>

     

  • Hi, can anyone tell me what the emoticons in this code are supposed to be? I've tried :O and it didn't work.



    Thanks

    Tania
  • "<convio:op>" and "</convio:op>" 

    If it didn't work when you tried replacing the emoticon with ":o" just be sure you are using those exact characters and not adding anything funky in.  If you are still having problems, you can use the built-in personalization tools to add the basic xml tags to your text and then tweak, or you can use the [[ ]] bracketed syntax rather than the xml.



    And now, side note to vent: Aren't those emoticons so frigging annoying in all these older posts!!??  Bad conversion flaw to this new community site.  I am new to LO and only just joined this community about 8 months ago, so I hadn't used it a ton before it converted to this new layout, but seems like it was easier before to peruse the wisdom... As far as I can tell, you can't go to a particular user anymore and read all their past posts - which is so useful when you find someone who knows their stuff and actively contributes.  And so frustrating that so many of the helpful links in these posts are broken now.  Maybe there are some great benefits to the new communities and resources, though?  I'd love some tips on how to maximize them!

Categories