Hi there,
I'm trying to set-up my form so that the submitter has the option to get a copy of the results - it's not working so far and I'm not sure what's missing. This is the code I have on the form:
<input type="checkbox" name="emailcopy" id="emailcopy" value="1" />
This is the field on the form where they enter their email:
<input type="text" size="40" name="Email" />
And on the "On Submit code - before sending email:" I add this line of code that I found on theforum:
<?php
if ( !$_POST['emailcopy'] ) {
$rows[0]->emailresults = 0;
}
?>
Can someone please tell me what is missing. Thanks in advance.
Hi Likestuff,
I'm not sure, turn debug on and see what gets returned in $_POST['emailcopy'] - possibly it returns a value for both checked and unchecked states in which case you'll need a more specific test in the if clause.
Bob
and please tell how its not working, what happens exactly!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Well the email data gets sent to the correct email and at the bottom of the email is this: emailcopy 1
But a copy of the email is not sent to the the users email.
I have debug turned on but there are no errors showing.
Thanks!
good, actually what you need is to add this in the before submit box :
<?php
if ( $_POST['emailcopy'] ) {
$rows[0]->extraemail = $rows[0]->extraemail.','.$_POST['email_field_name'];
}
?>
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Yes! Yes! Yes! It worked.... Just one more thing. Is there a way to remove "emailcopy 1
" from the email? It's included in the email at the bottom.
Thank you so much!
Hi LIkestuff,
I think that putting 'emailcopy' in the Omitted fields box will omit it from the email.
Bob
I'm doing the happy dance! Thank you guys for hangin' in there with me to get it working - really appreciate your patience.😀
My happy dance stopped 😟
A copy of the email is not been sent to the submitter. Do I have everything the way I should? Here are the settings.
The name of the email field is:
Email
The Check Box code:
<input type="checkbox" name="emailcopy" id="emailcopy" value="1" />
On Submit code - before sending email:
<?php
if ( $_POST['emailcopy'] ) {
$rows[0]->extraemail = $rows[0]->extraemail.','.$_POST['Email'];
}
?>
Thank you!
Hi Likestuff,
Has this never worked or has something changed since last year?
Which versions of Joomla and ChronOforms are you using?
Bob
Hi Greyhead,
I'm sure it worked before but I had removed it temporarily. Now I'm trying to reinstate it again.
I updated to the most recent version of Chronoforms (3.0) and I'm using Joomla 1.5.8.
Thank you!
Hi Likestuff,
In ChronoForms 3.0, add a 'Dynamic To' field to the Email template and put the name of the email field in it (with no brackets or quotes).
Bob
Thank you Greyhead. You are awesome.
Just one other thing. I'm looking for the "Omitted Fields" box but I don't see it. I would like to remove "emailcopy 1" from the email.
Thanks.
Hi Likestuff,
Thank you 😶 😀
The Omitted fields disappeared in ChronoForms 3.0 Once your form is stable edit the email template to keep or remove whichever entries you want.
Bob
Ohhhh I see.
Thanks again 😀 😀
Hi Guys,
I have been following this thread and I am still stuck. With Debug I can see that my POST array is appropriately containing the '1' or not based whether the user checked the field. The problem is the user is getting the email regardless of checking or not.
To me it seems this is happening because I added the 'dynamic To' field which seems to have no correlation whatsoever to this javascript.
Ideas??
Thanks.
Hi mtlhead,
This is a year old thread and may well not be completely consistent with the current version of ChronoForms. There are more up to date threads about sending emails.
I also don't see any JavaScript here so not sure what code you are using.
Bob
Thanks for the reply Bob,
I have decided to just send the user a copy without asking them. It was not that big of a deal and I'm pressed for time.
Sorry for not posting the code.
Hello together,
first, sorry about my english - I'm german. But I'll try my best.
How can I get a mail copy to the submitter, if he want this (checkbox)?
I hope, someone can help me.
I'm using ChronoForms_3.1 RC5.2
Hello Bob,
thanks for the answer.
I hope I understand the posts in that thread.
kind regards,
kareh