[TYPO3-english] Send email to fe_users upon news creation

Bernard Munslow bernard.munslow at iws.es
Thu Apr 14 10:35:47 CEST 2011


Hi Jeppe,

No need to tamper with the files in the tt_news module at all.

Have a look into the link I send in the last mail.

All you have to do is create a new extension with the kickstarter, and 
create the file with the hook.

You'll probably want to instantiate a hook in TCEMAIN.  Your class can 
be something like this:

class tx_felo_tcemainprocdm {

function processDatamap_postProcessFieldArray ($status, $table, $id, 
&$fieldArray, &$reference) {

      if ($table == 'tt_news') {
          switch ($status) {
              case 'new':
                  /* Send email code */
		break;
...
		}
	}
}
}

HTH.

.- Bernard

El 14/04/2011 10:09, Jeppe Donslund escribió:
> Hi Bernard
>
> That seems to be what I need.
> Could you guide me, where to look for the creation of tt_news records?
> I think I should look for som mySQL insert lines somewhere.
>
> Jeppe
>
>
> On 14-04-2011 09:45, Bernard Munslow wrote:
>> Hi Jeppe,
>>
>> There probably are different approaches to do what you need.
>>
>> If you're ok with plain text emails, one possible way would be to
>> implement a hook which detects creation of tt_news records and then
>> simply send your notification using t3lib_div::plainMailEncoded or any
>> other implementation to send an email.
>>
>> This is an excellent tutorial on hooks in case you need some extra
>> information:
>>
>> http://typo3.org/development/articles/how-to-use-existing-hooks/
>>
>> Greetings,
>>
>> .- Bernard
>>
>> El 14/04/2011 9:37, Jeppe Donslund escribió:
>>> Does anyone know a way to send out emails ( a small newsletter ) to
>>> fe_users everytime there has been created a new news item?
>>>
>>> Bst regards
>>> Jeppe Donslund
>>
>



More information about the TYPO3-english mailing list