I have a bit of a problem i am trying to sort out.
I have 2-step form
page 1 (mandatory): fill in your personal details
page 2 (optional): complete your inventory
At the moment the form sends 2 emails to the recipient, 1 after the first page is completed, and one if the second page is completed. The second email is identical to the first except it has the inventory included below the personal details and the subject line states "quote request (email 2 of 2)".
Now I am trying to think of a way that I can delay the sending of the first email and only send it if the second step is aborted/abandoned.
This sounds like quite a common problem, anyone have any simple solutions? The best I could come up with is this:
1) Step 1 is completed and email is not sent instead a database boolean "sent" set to false along with a timestamp 2) the user is given 15 minutes to fill in the second form, if it is not completed in that time a cronjob will detect it and email the personal user details without the inventory and set the database bool "sent" to true
If the user takes longer than 15 minutes then I guess the email will have to sent again, so it's not a failproof way of preventing duplicate emails..
any suggestions?