Hello,
I made a form on which I put a checkbox that the sender has to mark to receive a copy of the message.
I added the code in "On Submit code - before sending email":
<?php
if(JRequest::getVar('check0')) {
$emails[0]->to .= ','.JRequest::getVar('text_3');
}
?>
Check0 is the name of the checkbox and text_3 is the name of the e-mail text field.
I made tries but when the checkbox is marked no copy of e-mail is sent.
I made tries on a personal wamp server and I obtain the errors:
Notice: Undefined variable: emails in C:\wamp\www\monsite\components\com_chronocontact\libraries\customcode.php(64) : eval()'d code on line 3
Notice: Undefined offset: 0 in C:\wamp\www\monsite\components\com_chronocontact\libraries\customcode.php(64) : eval()'d code on line 3
Can anybody help me?
I specify that it's work on another site with the version 3.1RC2 of chronocontact while on the site it is the version 3.1RC5.5.
Thank you for the help.
Jean-Pierre (France)
Hello Fredrik,
Thank you very much for your help.
Its works very well !! 🤣
Thanks you for your answer.
Best regards
Jean-Pierre
Hi neronero,
What are you actually trying to do here?
Does your form send an email without this code?
Bob
Hi,
I'm really sorry I was not clear.
I created a form, and I received the mail. After it I added a checkbox and the sender has to mark to receive a copy of the message.
As I understood from the previous notes, I have to add a code in "On Submit code - before sending email"
So I tried this, without succes.
Dear Bob,
Thank you for the help.
The problem is that after the suggested modifications, not only the copy of the emial, but even the original message haven't arrived.
Any other idea, what can I do wrong?
Thanks
Rita
Hi Rita,
Please turn on Form Debug, submit the form and copy and paste the resulting Debug messages and email report here.
Bob
Hi Bob!
Here is the debug message:
1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array ( [text_0] => Company name [text_1] => test [text_15] => [text_2] => Name[text_3] => 123 [text_5] => [text_13] => [text_4] => [check0] => Array ( [0] => igen ) [text_14] => [Küldés] => Küldés [d743c2a10ea6b469864951d993db471a] => 1 [1cf1] => b8ef43674a4d5ce82d4c282c57beb5d5 [chronoformname] => erdeklodes )
6. $_FILES Array: Array ( )
7. Form passed the plugins step (if enabled) OK
8. An email has been SENT successfully from (Company name)email to email
9. Debug End
thanks in advance
Hi Rita,
And the dummy email report from the same page please.
From the report here it looks as though the To & From Email addresses for your email are both the same. This seems to get emails dropped quite often. Please test with different To & From Email addresses.
Bob
Hi Bob!
Here is the email:
From: Name [email]
To:email
CC:
BCC:
Subject: Érdeklődés
Cégnév
Company name
Székhely
test
Email
[email]name@gmail.com[/email]
KapcsolattartĂł
XY
Telefonszám
123
Jelenlegi szolgáltató
Jelenlegi szerződés lejárta
Éves fogyasztás
Ăśzenet
Másolatot kérek az üzenetből
igen
Sorry, the fields name are Hungarian...
I modified the To & From Email addresses not to be the same, but nothing changed
Thank for your help.
Hi Rita,
That all looks good.
Can your site send emails OK from other pages?
Bob
PS By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.