Form Generator - Email Form Results

By daniel - February 12, 2019

Hi Shawn,

I may have been a little unclear in my previous post; I was pointing out common.php as the place where you can find the sendMessage() function and some examples of its usage. Instead, I'd recommend adding the sendMessage() function to the form page so that it runs after the form is successfully submitted (probably somewhere after fg_util_insertOrUpdateRecord() gets called).

Here's an example of a basic sendMessage() call:

$mailErrors  = sendMessage(array(
  'from'    => 'from@address.com',
  'to'      => 'to@address.com',
  'subject' => "Subject line",
  'text'    => $messageText,
));
if ($mailErrors) { trigger_error($mailErrors, E_USER_ERROR); }

You will need to update the from/to/subject, plus create a $messageText variable containing the email body, including any form submission values you want.

Let me know if that helps!

Thanks,

Daniel
Technical Lead
interactivetools.com

Awesome, thank you very much! That worked perfectly.

Shawn