close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Using IF statements with Universal Email

Thread began 3/28/2015 11:37 am by MagsW | Last modified 3/31/2015 1:32 pm by Jason Byrnes | 820 views | 8 replies |

MagsW

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.

Sign in to reply to this post

Jason ByrnesWebAssist

I dont quite follow what you mean by "Sending Again" It should only ever send once if the checkbox is checked and the form submitted. it would only ever "send again" if the form was submitted again.

Sign in to reply to this post

MagsW

Hi Jason, the emails are on the standard record update page, which contains all the usual account details - name, email address etc - but also contains checkboxes to indicate how far in a signup process they've come - order received, contract signed etc. When an administrator updates the record by ticking 'order received', this sends an email to the contact telling them what to do next. Once they've done that and signed a contract, the admin person logs in again and ticks the 'contract signed' box which sends another confirmation email. However, this also resends the 'order received' email.

I've tried various methods of preventing the Order Received emails from being sent when the Contract Signed box is ticked but nothing's working - I tried this to get it to send the Order Received email only if the value in the ContractSigned column is 0:

<?php if(isset($_POST['OrderReceived']) && $_POST['OrderReceived'] == "1") { ?>
<?php if ($row_WADAclients['ContractSigned'] == "0") { ?>
[Universal Email script for Order Received email in here]
<?php } ?>
<?php } ?>

I also tried this as suggested by you in this thread: http://www.webassist.com/forums/posts.php?id=3983 as it's basically the same issue:

<?php if((isset($_POST['OrderReceived']) && $_POST['OrderReceived'] =="1") && (isset($_POST['ContractSigned']) && $_POST['ContractSigned'] !="1")) { ?>
[Universal Email script for Order Received email in here]
<?php } ?>

That doesn't work either - both the Order Received and Contract Signed emails get sent.

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

MagsW

Hi Jason, details in PM section.

Sign in to reply to this post

Jason ByrnesWebAssist

Please provide a Skype username or a US phone number and a good time to contact you when you will be in front of your computer and we will have an engineer contact you to resolve this issue over the phone.

We are available Monday - Friday from 9am - 4pm EST (except major U.S. holidays).

Sign in to reply to this post

MagsW

I'm in Scotland so 6 hours ahead of you here. I'll be here all day tomorrow so if you want to call any time after 9am your time, I should be around. Skype details in PM section.

Sign in to reply to this post

MagsW

Hi, I think I solved the problem with the following code:

<?php if(isset($_POST['OrderReceived']) && $_POST['OrderReceived'] =="1" && ($_POST['ContractSigned'] != "1")) { ?>

No need to contact me now!

Sign in to reply to this post

Jason ByrnesWebAssist

ok, glad to her it is working

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...