How to handle "else if" statement?

Options
I built out this conditional using XML syntax, but in testing I wasn't getting the results I need! I think I need to rebuild it—can you help?


I need to output one line of text depending on which group a user is in—there are 3 groups. They can be in multiple groups, but they should only get ONE line of text.


Here's the logic:


if ( group_id == gid1 ) {

//then message 1

} else if ( group_id = gid2 ) {

//then message 2

} else {

//then fallback, message 3

}


Broken down into use cases:


Message #1 will be sent to:

* People only in group 1

* People in groups 1 and 2

* People in groups 1, 2, and 3


Message #2 will be sent to:

* People only in group 2

* People in groups 2 and 3

(not anyone in group 1)


Message #3 will only be sent to:

* People only in group 3

(not anyone in groups 1 or 2)


Is there a way to write this so that two lines of content don't end up printing out?


This is for an email!


LMK, thank you. -c
Tagged:

Comments

  • I don't use Luminate, but just in looking at your text and knowing if/then statement ideas and following the formats through..... do I see a double equal sign in your first (group_id==gid1)???

Categories