[TYPO3] mailformplus: adding extra fields and sending multipart/mixed mail

Claudio Strizzolo claudio.strizzolo at ts.nogarb.ageinfn.it
Fri Mar 14 09:51:38 CET 2008


Hi all
I have two questions about the Mailformplus (th_mailformplus) extension:

1. After the form was submitted by the user, I need to add some extra
   fields according to some fields the user put in.
   A (stupid) example: the user can select an item through a dropdown
   box:

        Choose your favourite fruit: banana
                                     apple
                                     orange

   Now, I need to send to the mailform target both the fruit supplied
   by the user, and its color that I can automatically get from a
   database, a text file or another means, after the user has
   submitted his/her choice. For instance I might have a text file
   like:

         banana,yellow
         apple,red
         orange,orange

    So in the template for the mail sent to the user, something like 
   this should appear:

            Favourite fruit: ###fruit###
            Color of the fruit: ###fruit_color###

    Is there any way to get this? I tried by using a post-processing
    function as suggested on http://typo3.org/documentation/document-
library/extension-manuals/th_mailformplus/4.0.5/view/1/5/#id3823153
    but it does not work: it looks like I cannot actually add
    new fields or modify the ones supplied by the user. At the least
    not with such a syntax:

<?php
class myform_postproc {
function doit(&$params, &$ref){
  (...)
  $params["data"]["fruit_color"]="(got it somewhere)"; 
}
}
?>

    BTW, I thought the right syntax to reach the fields supplied by the
    user was $params[fieldname], but after some tests I saw that I can
    see their values only through $params["data"][fieldname].

2. Is there any way to send out the output of the form to the final
   target, both in text and HTML format (provided both have been 
   configured in the template), as a multipart/mixed instead of
   multipart/alternative document? I need to make both formats
   available to the user at the same time, not just one as an
   alternative to the other.

Thanks in advance

Claudio


More information about the TYPO3-english mailing list