+ Reply to Thread
Results 1 to 4 of 4

Thread: Form Results as HTML Attachment

  1. #1
    Join Date
    Apr 2010
    Posts
    20

    Default Form Results as HTML Attachment

    I don't know whether this is a bug or not. I posted this in the Community Forum and a helpful user who appears quite knowledgeable with formmail tried to help but couldn't figure this out. So I don't know if I'm trying to do something formmail can't do or can do but isn't working as it should be (or perhaps I'm doing something wrong). In any event, I'll post it here and you can tell me if it's a bug or not.

    I have the following fields in my form:

    <input type="hidden" name="filter" value="null" />
    <input type=
    "hidden" name="filter_options" id="filter_options" value="Attach=App_Submission.html" />
    <input type=
    "hidden" name="mail_options" id="mail_options" value="HTMLTemplate=adopt_app.html,TemplateMissing=Blank,AlwaysList,NoPlain" />
    But what I get in form results is an e-mail in which there is formatted results using my adopt_app.html template, an attachment called App_Submission.html but when I click on the attachment, it is simply an unformatted string of field names followed by a colon then the field result (no returns just one long string wrapping based on the size of your browser window). The source of the html is formatted only inasmuch as there are returns after each field. (All of this is posted in Community Forum if you need to see the results).


    I initially tried to get a formatted html file attachment (using adopt_app.html) without the "NoPlain" property on the mail_options value but got the same results.

    So is this a bug? Since I don't know formmail very well I can't judge. I'm going by the user that tried to help. And if it is a bug, well then I guess I'm reporting it here.

    I would like to know though so I can tell if it's my problem or a formmail problem.

  2. #2
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: Form Results as HTML Attachment

    Hi,

    crabtree almost knows FormMail better than I do!

    I've checked his replies and they all make sense (but might not be correct, see below).

    This definitely isn't a bug, but it might not be a feature that currently exists.

    The area of "HTML vs Plain templates and what gets attached and what doesn't" is complex.

    It's evolved over time and the implementation is really "what most people want". And, in this case, it really means "what most people who use our FormMailEncoder (encryption product) want".

    In other words, we've implemented the default combination of these features so that if you're using:
    • a PlainTemplate, plus,
    • an HTMLTemplate, plus,
    • a filter,
    • and you've specified to attach the filtered results,
    FormMail will:
    1. put the HTML (expanded template) in the body of the email
    2. expand the Plain Template
    3. filter the expanded Plain Template
    4. attach the filtered output.
    From what I've read, you haven't specified a PlainTemplate. So, I'm not sure just at this minute exactly what FormMail is going to do.

    From your description, you're getting plain text (without a template) attached, and the expanded HTML template in the email body.

    That kind of makes sense given the defaults I've specified above.

    Like crabtree, I'm going to have to run some tests to figure out if it's possible to achieve what you want.

    My current guess is no. (but see below for a last-second idea!)

    We've known for some time that this is such a complicated thing when you start piling on the features specified in your form.

    And, we've been thinking about how to make it more flexible.

    In your case, you want to say:
    • put plain text in the body (if any)
    • put HTML in an attachment
    crabtree suggested using our "null" filter to achieve this, but that's not working.

    So, we need to come up with a way for your form to specify this to FormMail.

    I've just had an idea.....

    Leave everything unchanged, except replace "HTMLTemplate=" in your "mail_options" field with "PlainTemplate=".

    So, you're going to lie to FormMail and tell it the HTML template you have is really a plain text template.

    It shouldn't make much difference to the processing, but it might just make the HTML get attached.

    If that doesn't work, then I think you'll have to wait until we add a new feature for explicitly controlling what goes where.

    BTW, the other option is additional PHP code hooked into FormMail. But that's a fair amount of work.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Apr 2010
    Posts
    20

    Default Re: Form Results as HTML Attachment

    Woo hoo! It worked! Just wanted to post a response so that you knew and didn't have to go through the trouble of testing your theory out.

    If you make future changes to formmail to specifically address this, should I be worried that the change I've now implemented will stop working?

    In any event, THANK YOU! This takes a load off. I no longer have to figure out how to address my unique problem.

    And in case crabtree is reading....thank you too for all your help!

  4. #4
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: Form Results as HTML Attachment

    Hi,

    Woo hoo! It worked! Just wanted to post a response so that you knew and didn't have to go through the trouble of testing your theory out.
    Terrific!

    If you make future changes to formmail to specifically address this, should I be worried that the change I've now implemented will stop working?
    It probably won't stop working. But, whenever you grab an upgrade, you always have to test.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Sample HTML Form Using FormMail
    By russellr in forum FormMail
    Replies: 1
    Last Post: 21-Mar-2007, 07:49 AM
  2. Sending form results in an HTML email
    By russellr in forum HOWTO Guides and Tips
    Replies: 26
    Last Post: 12-Jan-2006, 09:31 PM
  3. Submitted form output onto HTML page?
    By LKimber in forum FormMail Subscription Support
    Replies: 2
    Last Post: 13-Apr-2004, 11:39 AM
  4. Adding Attachment Variables
    By Bella in forum FormMail Subscription Support
    Replies: 1
    Last Post: 12-Apr-2004, 10:43 AM
  5. not so intersting results
    By expisp in forum FormMail Subscription Support
    Replies: 4
    Last Post: 10-Feb-2004, 08:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts