Search…

X3 Photo Gallery Support Forums

Search…
 
metallissimus
Experienced
Topic Author
Posts: 331
Joined: 17 Oct 2019, 06:54

Send copy of form to sender

22 Mar 2023, 10:29

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?
www.danielbollinger.de – corporate photography
hochzeiten.danielbollinger.de – wedding photography
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Send copy of form to sender

22 Mar 2023, 23:13

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 ...
 
metallissimus
Experienced
Topic Author
Posts: 331
Joined: 17 Oct 2019, 06:54

Re: Send copy of form to sender

23 Mar 2023, 06:02

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.
www.danielbollinger.de – corporate photography
hochzeiten.danielbollinger.de – wedding photography
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Send copy of form to sender

23 Mar 2023, 06:16

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);