pphpMailer is a PHP 5 class that can take an HTML input and send it as
a new mail message to a defined address or list of addresses.
If you start with the output of your form handler, very likely you
will end up with a bunch of variables being populated by the form,
maybe a list like:
- $email
- $subject
- $first_name
- $last_name
- $address
- $message
etc.
You would create a pretty page in Freeway that includes snippets of
PHP that can take those variables and inject their current value into
the generated HTML. You could make that page as graphically rich as
you like, although you would need to follow the rules for making HTML
mail – resources have to be uploaded to a public server somewhere,
all links to resources need to be rewritten to point to the complete
public URL, etc. Freeway 5.5 includes an Action that automates that
part for you, or you can use Tim Plumb’s Remote Resources instead for
the same purpose.
Each snippet of PHP would look like this: <?= $email ?>
or whatever
the variable was named. Your form handler would be extended to replace
all of the variables before passing the result on to phpmailer for
delivery. So that part might look like this:
//make sure all the variables are filled first, then
ob_start(); //create an output buffer to capture the rendered HTML
include('path/to/template.php'); //include your Freeway template
$html = ob_get_clean(); //extract the code, erase the buffer
//create the mail
require_once('path/to/phpmailer.php');
$mail = new PHPMailer();
$mail->From = you(a)example.com;
$mail->FromName = 'You';
$mail->Subject = 'New Form Request';
$mail->AltBody = 'text only version goes here';
$mail->MsgHTML($html);
$mail->AddAddress('to(a)example.com','To');
$mail->Send();
That’s off the top of my head, might work, might not, but should show
you the logical steps needed to get this off the ground. You would
need to be able to edit and understand the control flow of your
existing form handler, so it’s best if you have already written some
code and have a feel for how that works before you go off on this
tangent. But it’s probably the simplest way to create a “pretty” email
for your client to view form results.
Walter
On Sep 15, 2010, at 10:19 AM, sampolfonz wrote:
Walt,
I would have quite a bit of reading/learning to do to understand
what you are talking about. Can you point me in the right direction
of where to look to learn what you are describing?
Thanks,
Rich
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options