Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

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

Questions related to using nuBuilder Forte.
Olikun
Posts: 68
Joined: Tue Mar 09, 2021 6:45 pm

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

Unread post by Olikun »

Hello,

I have new question

Is it possible to send a completed form by email?
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

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

Unread post 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); 
Olikun
Posts: 68
Joined: Tue Mar 09, 2021 6:45 pm

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

Unread post by Olikun »

ok, but when will the form be sent?
Save after each?
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

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

Unread post 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()
Olikun
Posts: 68
Joined: Tue Mar 09, 2021 6:45 pm

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

Unread post by Olikun »

do I have to change something in the "Setup => eMail Settings"?

Image
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

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

Unread post by kev1n »

Sure, fill in your email SMTP settings
Olikun
Posts: 68
Joined: Tue Mar 09, 2021 6:45 pm

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

Unread post 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: /
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

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

Unread post by kev1n »

The 7th parameter is true, that means it should already be sent as HTML.
Olikun
Posts: 68
Joined: Tue Mar 09, 2021 6:45 pm

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

Unread post 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.
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

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

Unread post by kev1n »

Do you want to send all records as a separate email?
Post Reply