[Pro] The Way a Form Appears in an Email

Greetings.

Is there a way to control how a form looks when it is emailed to the recipient? I want the final to look more like a completed pdf file, instead of lines of text in an email.

Any way to make this happen?

Thanks,

Rich


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What do you mean by “mailed to the recipient”? Do you mean the form data that is sent by the server to the client?

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The form data can be converted into a PDF file on your server (host
permitting) and then attached and sent to the recipient but I know of
no easy way to do this. If I where to do this for a site I would
probably use FPDF from http://www.fpdf.org/ although this is simplar
to use after you have set it up a couple of times it involves a lot of
work for a novice and you would need to how a reasonable amount of
php. The process would be to install FPDF on the server, alter the
FPDF class to suite the layout of your form data then use the data in
the form handler script and run it through the fpdf class to generate
a pdf file, when that has been created it could then be attached to
the email sent to the recipient. This could of course all be done on
the press of the ‘Submit’ button on your form and you then receive the
form data as a PDF file and not as text in an email… I take this is
what you mean!

Sorry it is not an easy solution but HTH.

On Sep 15, 2010, at 5:32 AM, sampolfonz wrote:

Greetings.

Is there a way to control how a form looks when it is emailed to the
recipient? I want the final to look more like a completed pdf file,
instead of lines of text in an email.

Any way to make this happen?

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

You can also just format the results as HTML using normal PHP/Freeway
techniques, then use the phpMailer class[1] to convert that HTML into
a multipart mail message.

Walter

  1. Phpmailer le site qui parle de cinema - streaming - e-commerce - cosplay

On Sep 15, 2010, at 5:14 AM, Mike B wrote:

The form data can be converted into a PDF file on your server (host
permitting) and then attached and sent to the recipient but I know
of no easy way to do this. If I where to do this for a site I would
probably use FPDF from http://www.fpdf.org/ although this is simplar
to use after you have set it up a couple of times it involves a lot
of work for a novice and you would need to how a reasonable amount
of php. The process would be to install FPDF on the server, alter
the FPDF class to suite the layout of your form data then use the
data in the form handler script and run it through the fpdf class to
generate a pdf file, when that has been created it could then be
attached to the email sent to the recipient. This could of course
all be done on the press of the ‘Submit’ button on your form and you
then receive the form data as a PDF file and not as text in an
email… I take this is what you mean!

Sorry it is not an easy solution but HTH.

On Sep 15, 2010, at 5:32 AM, sampolfonz wrote:

Greetings.

Is there a way to control how a form looks when it is emailed to
the recipient? I want the final to look more like a completed pdf
file, instead of lines of text in an email.

Any way to make this happen?

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


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

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

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

As always, thanks for your wisdom and expertise.

Rich


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There is always the option of actually creating a PDF form in Acrobat that is downloaded by the visitor and which includes a submit button that will then open their email client and email the completed form.

I know that this is not what you asked about but sounds like a lot less hassle than the perviously suggested methods.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Dave…

Mmmm. If the visitor downloads the pdf form, doesn’t he have to have a program on his computer to complete the information in the pdf form? And, does the submit button have code attached to it that would instruct the email to grab the pdf and send it?

You are right, in that it sounds like a lot less hassle.

Rich


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Be thoughtful about “exporting” the hassle to the user. Users are many, and you are few. Users have n^n ways to screw things up, and you hopefully can restrict their opportunities to do so and can test your work. I would always come down on the side of making things easy/removing opportunities to screw up for the user rather than making things easier for you.

For example, if you set a form’s action to mailto:you(a)example.org, a properly configured browser/email client combo will pop open a new message with the form contents, hopefully for the user to press send. That’s a couple of orders of magnitude less likely to work than a properly configured PHP Feedback Form Action on a working (ie not GoDaddy) server.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Agreed.

I am going to work on it today and see what I can come up with.

Thanks.

Rich


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If the visitor downloads the pdf form, doesn’t he have to have a program on his computer to complete the information in the pdf form? And, does the submit button have code attached to it that would instruct the email to grab the pdf and send it?

They only need Adobe Reader which is ubiquitous and Free. And yes the form opens their email client ready to send.

I agree that the PHPFF form is the way to go but you did say you wanted a pdf experience.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options