Page 1 of 2

Send the form (data record) by email - possible?

Posted: Fri Apr 23, 2021 5:13 pm
by Olikun
Hello,

I have new question

Is it possible to send a completed form by email?

Re: Send the form (data record) by email - possible?

Posted: Fri Apr 23, 2021 5:30 pm
by kev1n
Hi,

Use the PHP After Save (AS) event to send the email.

In this example, cus_name, cus_phone, cus_email are Hash Cookies (or object IDs on the form)

Code: Select all

$body = 

"Hello <br><br>".
"Some text ...<br><br>".
"<b>Name:</b> #cus_name#<br>".
"<b>Phone:</b> #cus_phone#<br>".
"<b>Email:</b> #cus_email#<br>";

$subject = "Email XYZ #cus_name#";

$from_name = "nuBuider";
$from_address = "admin@your_domain.com";
$to = "someone@something.com";
$cc = "";
$bcc = "";

  
nuSendEmail($to, $from_address, $from_name, $body, $subject, [], true, $cc, $bcc); 

Re: Send the form (data record) by email - possible?

Posted: Fri Apr 23, 2021 5:36 pm
by Olikun
ok, but when will the form be sent?
Save after each?

Re: Send the form (data record) by email - possible?

Posted: Fri Apr 23, 2021 5:38 pm
by kev1n
"After Save" is the event that is called after saving the form.
You could also send the form/email on a button click. Then you'd have to use a PHP Procedure and call that with nuRunPHPHidden()

Re: Send the form (data record) by email - possible?

Posted: Fri Apr 23, 2021 6:40 pm
by Olikun
do I have to change something in the "Setup => eMail Settings"?

Image

Re: Send the form (data record) by email - possible?

Posted: Fri Apr 23, 2021 6:58 pm
by kev1n
Sure, fill in your email SMTP settings

Re: Send the form (data record) by email - possible?

Posted: Fri Apr 23, 2021 8:18 pm
by Olikun
it works very well as always

Is it also possible to send the email as html?
So that you can design the email.


Otherwise everything is one below the other and it doesn't look good: /

Re: Send the form (data record) by email - possible?

Posted: Fri Apr 23, 2021 8:51 pm
by kev1n
The 7th parameter is true, that means it should already be sent as HTML.

Re: Send the form (data record) by email - possible?

Posted: Sat Apr 24, 2021 11:18 am
by Olikun
thanks for the help, it works, but i have a change

How can I change the fact that the form content is always sent by email at 8:00 p.m. without having to go to the selection.

If you save the form, no email should be sent.

Re: Send the form (data record) by email - possible?

Posted: Sat Apr 24, 2021 11:22 am
by kev1n
Do you want to send all records as a separate email?