CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Feature #9191

Patch for multi-templates and conditions in Tx_Formhandler_Finisher_Mail

Added by Joss Herrmann almost 3 years ago. Updated over 1 year ago.

Status:Rejected Start date:2010-08-06
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:Finisher
Target version:-
Votes: 0

Description

I wrote this patch (against Rev. 36434) because, we need to send more than 2 different mails, depending of the form values (in $this->gp) and have to attach a pdf-file, generated from a prev. finisher.

So i've added some features to the Tx_Formhandler_Finisher_Mail class.

A more detailed description is available in the class comment (attached patch).

Our project is still in test phase, so maybe there will be some improvements/bug-fixes in future.

Greets,
Joss

Tx_Formhandler_Finisher_Mail.patch - The Patch (15.9 kB) Joss Herrmann, 2010-08-06 19:50

Tx_Formhandler_Finisher_Mail.patch (13.8 kB) Joss Herrmann, 2010-09-17 15:26

History

Updated by Reinhard Führicht over 2 years ago

  • Status changed from New to Needs Feedback

Thanks for sharing.

Some short notes:

- I don't like the conditions inside single settings. Why not leave the conditions where they are now?
- I agree to not only use the "user" and "admin" section, but enable the user to enter any key she wants. I wanted to include this some time ago, but forgot about it.

So just so that I understand everything correctly:
- What about those conditions?
- Isn't it possible to do the same thing with conditions as they are now?
- What does "attachLocalFileFromGPField" do exactly?

Updated by Joss Herrmann over 2 years ago

In our project the sending of mails depends on the values in $this->gp (some previous finishers write their results in there). Additionally we need to check, that the given string is part of the value in $this->gp (using strpos()). So I added the posibility to use an '*' after the '='.
The posibillity to set a condition in a single string (conditions = key=value) is not really nessesary and maybe a bit confusing. We use this because we have lots of email-templates already using this syntax before implementing parseConditions().

We use a special pdf-generator (to fill pdf-templates) that writes the path of the generated pdf-file in $this->gp['filePath']. If you set attachLocalFileFromGPField = filePath, the file will be send as an atachment.

Greets, joss

Updated by Reinhard Führicht over 2 years ago

Regarding attachLocalFileFromGPField: Wouldn't it be enough to just set attachment = filePath.
As far as I remember without checking the code, The attachment option takes a list of paths or names of keys in $this->gp.

Updated by Joss Herrmann over 2 years ago

AFAIK the attachment-option searches the keys in the session. Our finishers only sets the variables in $this->gp. So i resolved this by adding a the attachLocalFileFromGPField option.
But you're right. I only have to update the session after setting the new keys in our finishers and it should work with the attachment-option. I will change that and remove the attachLocalFileFromGPField-option the as soons as possible.

Updated by Joss Herrmann over 2 years ago

Here is a new version of the patch (against Rev. 36528), without the attachLocalFileFromGPField-option.

Updated by Reinhard Führicht over 1 year ago

  • Status changed from Needs Feedback to Rejected

This is also possible with Formhandler conditions and maybe numerous Finisher_Mail components

Also available in: Atom PDF