Adding Conditional Code to a Team Raiser Thank you for Gift Autoresponder

Options
We have a team raiser starting up where any donor who makes a gift of $50 or more will be eligible for 2 tickets to a party at the event. We want to include information on this party and how they can get their tickets in the autoresponder but only for those who have made a gift of $50 or more.


I think the S120 code will work based on what I am reading but I'm never 100% sure. Are either of these lines of code correct? Not sure if I need the tr id in there (1250). 


[[?[[S120:1250:amount > 49.99]]::TRUE::ADD CONTENT HERE ABOUT BEACH BASH.::]]


or


[[?[[S120:dc:giftamount > 49.99]]::TRUE::ADD CONTENT HERE ABOUT BEACH BASH.::]]


Any advise would be great. 


Thanks, 

Karen

 
Tagged:

Comments

  • You can't do the greater-than test inside of the S120 tag. That tag just spits out a value. It should be


    [[S120:dc:amount]]


    Lets do the rest in steps...


    You can do polish notation math with the E130 tag. There are several posts about this tag to search for, it's pretty weird and interesting.

    EDIT: Chris did a lot of backwards engineering of E130 here: https://community.blackbaud.com/forums/viewtopic/1/961?post_id=961#p961


    I think that should look like:


    [[E130: [[S120:dc:amount]] 49.99 >]]


    Using an S120 as input into the E130 tag! Neat. That should spit out 1 for true and 0 for false.  (Shout out to E130 Pal at https://eduardoagarcia.com/dev-tools/e130/index.html)


    And now we can do the conditional. Conditionals looks like this:


    [[? foo::bar::this::that]]


    Which means "If foo contains bar show this otherwise that"

    EDIT: This old post goes over conditionals. https://community.blackbaud.com/forums/viewtopic/1/16648?post_id=53812#p53812


    So for us its:


    [[? [[E130: [[S120:dc:amount]] 49.99 >]] :: 1 :: ADD CONTENT HERE ABOUT BEACH BASH.::NO CONTENT]]


    That right there should work, but to be safe lets make it constrain exact matches. What if our E130 expression returns 11 for some unforseen reason? 11 contains 1, so it would improperly show your block. So we do this:


    [[? x[[E130: [[S120:dc:amount]] 49.99 >]]x :: x1x :: ADD CONTENT HERE ABOUT BEACH BASH.::NO CONTENT]]


    Now we are looking to see if x1x contains x1x. That's much safer in most cases so its a good habit.
  • Taking it in steps like this is the way to build and test this stuff.


    Run a test donation with just [[S120:dc:amount]]. What does that return? (If it returns $100 rather than 100, it could mess up our next step.)


    Then try with the E130 block. Try it with a hard coded amount like this to make sure the math is right:  [[E130: 75 49.99 >]]  Does that return 1 or 0 correctly?


    Then move on to [[E130: [[S120:dc:amount]] 49.99 >]] and so on.


    Cheers, B


     
  • This is great information and a very logical explanation. I am going to test this afternoon and let you now how it works out. 


    Thank you Brian, 

    Karen
  • Little success - 


    For this test
    [[S120:dc:amount]]. What does that return?  - it returned 'no such property: amount'


    For this test 

    [[E130: 75 49.99 >]]  Does that return 1 or 0 correctly? - it did! the math worked


    But then for the big test

    to [[E130: [[S120:dc:amount]] 49.99 >]]  - it did not work, because of course the first test did not work because no such property


    Hmm. 

    To be clear. I am in a Team Raiser. This is in the Thank you for your gift autoresponder. Gift amount was showing up in the trasaction summary. I made a donation that was over the amount. 


    Here is the actual code (using 9 vs 49.99 so I am only testing with $10 donations):



    <p class="p3"><span>Is this showing the amount :</span>&nbsp;<span style="font-size: 10pt;"><convio:session name="120" param="dc:amount"></convio:session></span></p>

    <p>Is this showing a true value of 1:&nbsp;<span>[[? x[[E130: 75 9 >]]x :: x1x :: yes this value is one.::not this is not giving a value of 1]]</span></p>

    <p><span>Next line should show the conditional content about the tickets.&nbsp;</span></p>

    <p><span style="font-size: 10pt;"><span>[[? x[[E130: [[S120:dc:amount]] 9 >]]x :: x1x ::</span>Because your donation was $50 or higher, you will receive two complementary tickets to this Carly&rsquo;s Crossing Beach Bash on August 6, 2017. In order to redeem your tickets, click&nbsp;<a href="https://roswellpark.ticketbud.com/carlys-crossing-beach-bash-2017-51397277496a">here&nbsp;</a>and enter &lsquo;50Donor2017&rsquo; as your promotion code.&nbsp;</span><span style="font-size: 10pt;">::]]</span></p>


    What do you think?


    I am going to send this to someone else I know as well. If they figure it out I will let you know. 


    Thanks, Karen


     
  • Ah, darn it. Details, details! Well this is why it's good to test in steps. Try: [[S120:dc:giftAmount]]   EDIT: note that giftAmount is case sensitive.



    PS - Here's a old thread with all the S120 tags. You can paste that html into an autoresponder and see what the whole lot returns.


    https://community.blackbaud.com/forums/viewtopic/12/6628?post_id=110221#p110221


     

Categories