Bug #36467
use for cmd_compileMailGroup hook not equal in mod2 and mod3
| Status: | Needs Feedback | Start date: | 2012-04-23 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | Joerg Kummer | % Done: | 0% |
|
| Category: | Bug | Spent time: | - | |
| Target version: | - | |||
| TYPO3 Version: | PHP Version: | |||
| Votes: | 0 |
Description
In 2.7.0 a new hook for cmd_compileMailGroup in same named method in main class for BE-modul3 (recipientlist) is available for each given single mail-group.
In BE-modul2 (dmail) the same hook is used, but works once for end-result of all mail-groups, which will end in different results for BE-modul2 and 3.
Hook object call in BE-modul2 class tx_directmail_dmail is displaced in methode 'cmd_compileMailGroup', since a new method 'getSingleMailGroup' extends generations of 'id_lists', where it should be called. Patch attched.
History
Updated by Ivan Dharma Kartolo 12 months ago
- Status changed from New to Needs Feedback
- Assignee set to Joerg Kummer
do you mean, that the hook should be in the getSingleMailGroup() method? why that? by placing the hook in the cmd_compileMailGroup() method (mod2), the id_lists array are cleaned from any duplicates entry.
Updated by Joerg Kummer 12 months ago
Yes, it should be, if the hook method cmd_compileMailGroup_postProcess in mod2 offers a third argument $mailGroup like it has in mod3. Why: this argument is empty in hook method cmd_compileMailGroup_postProcess in mod2 (value doesn't exists). In the getSingleMailGroup() method there is a value given for this third argument $mailGroup.
I mean, the new extracted getSingleMailGroup() method (2.6.9>2.7.0) should regard the changes from Issue#10809.
BTW: Thanks for Fixing#10809.
In my case, my hook depends on this $mailGroup value, which I need both, for mod2 & mod3. My patch works well, and I can use the same hook-class for both moduls.
Updated by Ivan Dharma Kartolo 12 months ago
hmmm.. have you check the swiftmailer branch? both hooks have a third parameter, which ist the direct_mail recipient group's uid.
the differences, which i can find, are:- in mod2 it's called $groups and in mod3 $mailGroup.
- in mod2 the variable $groups is an array of group's id. Since in the last step you can choose more than one group to send the mail to. In mod3 it's the record array of the selected recipient group.
I'll change the hook, so that only an array with IDs will be given to the hooks.
Updated by Joerg Kummer 5 months ago
Didn't check swiftmailerbranch, whats this?
My wish goes mor in this direction:
If i can - via hook - manipulate a single mailgroup in mod3, it should be possible, to use the same manipulation for sending to this group in mod2.
Actually i use a 6th type of reciepientlist (to use raw sql for more komplex recipient structures).
The simplest way would be, just to add one more hook into method getSingleMailGroup().
There is the mail group value $mailGroup with 5 predefined possibilities. Here a hook like
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail']['mod2']['getSingleMailGroup']
would give the possibility to use same manipulation as in mod3 for single mail groups.
I tested with v3.0.3
Sorry, i found no fine way to create a diff-patch for my solution.
Updated by Joerg Kummer 5 months ago
- File direct_mail_mod2_compileMailGroupHook2.diff added
here my working changes as hook in a patch/diff on current version 3.0.3