Using IF statements with Universal Email
In my update record form I have the following checkboxes:
Order Received
Contract Signed
I have one email which is sent out when the Order Received box is ticked. I set this up as follows:
<?php if(isset($_POST['OrderReceived']) && $_POST['OrderReceived'] == "1") { ?>
[Universal Email script in here]
<?php } ?>
I have another email which is sent out when the Contract Signed box is ticked. This is set up in the same way:
<?php if(isset($_POST['ContractSigned']) && $_POST['ContractSigned'] == "1") { ?>
[Universal Email script in here]
<?php } ?>
However, I want to prevent the first email from sending again when the Contract Signed email is generated. I tried the following but it didn't work:
<?php if(isset($_POST['OrderReceived']) && $_POST['OrderReceived'] == "1") { ?>
<?php if ($row_WADAclients['ContractSigned'] == 0) { ?>
[Universal Email script in here]
<?php } ?>
<?php } ?>
Could you tell me how I can make it work so that I can stop the first email from sending again? Actually, I need to ONLY have these emails sending when the box is being physically ticked, not if any other updates are made, as there are of course other fields that could be updated at any point.