1. Important notice about Cloudbleed - if your site uses the Cloudflare CDN, and you intend to follow the Joomla security team's advice to change your site "secret", you MUST READ THIS NOTICE.
  2. Fabrik 3.6 Released Remember to backup and test your backup before proceeding with this update. Please report any problems you might experience with this new version here on the forum. You are safe to upgrade to Joomla! 3.7 and PHP 7.x with this version of Fabrik. View the blog for more details on this release.

Cron Email - Multiple Conditions PHP

Discussion in 'Standard Support' started by jsnider, Jul 22, 2013.

  1. jsnider

    jsnider Member

    Level: Community
    I have been able to set up scheduled cron emails that work great when I only have one condition. This condition works:

    return '{issues___project}'=='Amistad Apartments';

    I am trying to do a second condition, but when I add && or AND to the condition, it doesn't work. Can someone help me with the proper syntax to add another condition? Here is an example of what I have tried:

    return '{issues___project}'=='Amistad Apartments' AND '{issues___status}'=='Open';

    Thanks so much.
     
  2. jsnider

    jsnider Member

    Level: Community
    OK - as is the magic of the forum, as soon as I posted it, I found a string that worked. For others browsing through, here it is:

    return '{issues___status_raw}'=='Open' AND '{issues___project}'=='Amistad Apartments';

    The "raw" string seemed to help.

    Thanks
     
    JackGoa and cheesegrits like this.
  3. nfatsis

    nfatsis New Member

    Level: Standard
    Thank for the tip jsnider
     
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Supporter
    Use && rather than AND. They are almost the same, but not quite, and if you routinely use AND you will at some point get bitten by the difference. Always best to use && for simple boolean operations like that.

    The issue is operator precedence, see first answer ...

    https://stackoverflow.com/questions/2803321/and-vs-as-operator

    -- hugh
     

Share This Page