Page 1 of 1

Send copy of form to sender

Posted: 22 Mar 2023, 10:29
by metallissimus
I am working on a somewhat lengthy questionnaire for future clients: https://www.danielbollinger.de/kunden/k ... ragebogen/

Is there a way I can automatically send them a copy of the form (after checking a checkbox) without needing to modify PHP?

Re: Send copy of form to sender

Posted: 22 Mar 2023, 23:13
by mjau-mjau
metallissimus wrote:Is there a way I can automatically send them a copy of the form (after checking a checkbox) without needing to modify PHP?
Sorry, no, you would need to modify the PHP.

There are no options for this by default, because it can be tricky. Sending emails is already rather strict, and some servers might only be able to send to the owner of the account or email on the same domain. Besides, if the user fills the wrong email (for some reason), there will be an error and emailers don't like errors ;)

Anyway, I think it's not complicated, perhaps just a single line (if you don't want to detect success/fail) ... You have to add it to PHP though ...

Re: Send copy of form to sender

Posted: 23 Mar 2023, 06:02
by metallissimus
Thanks, I will think about it. I am hesitant to modify the PHP because as I understand I would have to manually do that again after every X3 update.

Re: Send copy of form to sender

Posted: 23 Mar 2023, 06:16
by mjau-mjau
You would only need to add one line I think. Open app/x3.api.php find on line 162:
Code
if($email) $email = filter_var(trim($email), FILTER_SANITIZE_EMAIL);
Add a new line below it on line 163:
Code
if($email) $mail->AddCC($email);