[TYPO3-english] DirectMail, dynamic SQL query?

Xavier Perseguers xavier at typo3.org
Mon Oct 7 08:25:46 CEST 2013


Hello Salander,

> Thanks for your answer.
> I've been looking to use direct_mail_userfunc during the whole week-end
> but this isn't noob-friendly at all. I don't understand anything about
> it.. Should I put my special querry in an itemsProcFunc?
> I have user_testlist->my_RecipientList by default, thanks to the advance
> configuration of direct_mail_userfunc.

Yes, that's it, the most basic usage is described in the documentation,
you register the class:

http://docs.typo3.org/typo3cms/extensions/direct_mail_userfunc/1.3.0/ExtDirectMailUserFunctions/DevelopersManual/RegisteringTheUserFunction/Index.html

and implement it:

http://docs.typo3.org/typo3cms/extensions/direct_mail_userfunc/1.3.0/ExtDirectMailUserFunctions/DevelopersManual/Index.html

Basically, what it does is when direct_mail encounters a "special
query", it will pass over the hand to your code to prepare the list of
recipients. Nothing more.

> Could you explain to me the basics of direct_mail_userfunc? I really
> don't get it.

If you need additional arguments as you do here for your example, you're
right, you have an "Additional Params" textarea below the select
userfunc and everything you write there is passed as
$params['userParams'] to your code:

http://docs.typo3.org/typo3cms/extensions/direct_mail_userfunc/1.3.0/ExtDirectMailUserFunctions/DevelopersManual/AdditionalParameters/Index.html

So it's up to you to choose what you want to write as "parameter". For
my uses, I created some wizard that prepares me a JSON encoded string
with selected parameters. The documentation describes the basics of
registering a wizard in BE. You may of course create something fancy in
ExtJS or whatever. Another (now I would be somehow "cleaner" and easier
to manage) solution would be to extend the FlexForm with custom fields,
just as you do for your extensions. I did not implement that but that
would certainly be feasible, similar to what I did to populate my
dropdown of registered userfuncs.

Kind regards

-- 
Xavier Perseguers
Release Manager TYPO3 4.6

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org



More information about the TYPO3-english mailing list