[TYPO3] Extension "comments" notification without the need to approve each comment?

Thomas Hirt info at thomas-hirt.at
Tue Sep 23 18:28:06 CEST 2008


Hi!
It works! Yipiiiiiiiieeee...

You where right Dmitry, it was the naming convention.

now:

ext_localconf.php in my extension:
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['comments']['processSubmission'][$_EXTKEY] 
= 
'EXT:comments_email/class.tx_commentsemail_hooks.php:tx_commentsemail_hooks->hookFunc';
?>

class.tx_commentsemail_hooks.php
<?php
class tx_commentsemail_hooks {	
	function hookFunc() {
		// the hard way to see if it is called ;) 	
		exit('I am called!');
	}
}
?>

Next step for me:

 > sending an email with the url of the new comment and the basic 
information (name, comment,...) out of a template.

 > great would be a switch:
	if aproval is checked --> no second email because it is sent anyway
	if approuval is not checked --> email from my function

 > Write a liitle how to in german...

 > Reading Dmitrys book ;)

I'll try if I can do this!

Biiiiiig thanks,
Thomas

PS: When will your book be ready for delivery?




Dmitry Dulepov [typo3] schrieb:
> Hi!
> 
> Thomas Hirt wrote:
>> 4) I added the file class.comments_email.php in the root folder of my 
>> own extension with the following code:
> 
> Class names must follow certain naming conventions. Looks how comments 
> does it: tx_comments_.... Do the same: tx_commentsemail_hooks, not 
> comments_email! TYPO3 is very strict about naming conventions, it will 
> simply ignore your class if you do not follow them! You need to start 
> from tx_, then extension key without underscores, then underscore, then 
> something else.
> 
>> The ext_localconf.php is definitly not included.
> 
> Why do you think so?
> 
>> Sorry that it takes soooooo long until I get it,
> 
> It is not long :) My first extension took three months to write. Now I 
> sometimes create several extensions per day.
> 


More information about the TYPO3-english mailing list