Hallo Forum,
ich hoff es kann mir jemand von euch weiter helfen.
Ich versuche gerade einen Hook in tt_news zu setzen damit eine Email versendet wird sobald es ein neues Element gibt.
Diese Email soll an eine Usergroup gehen.
Ich bin schon so weit, dass die Email versendet wird, jedoch will ich in die Message noch den Inhalt des neuen Elements einsetzten und der Empfänger sollen alle Emailadressen der User aus einer bestimmten Usergroup sein.
Hier mal das was ich bereits habe:
<?php class tx_notification_tcemainprocdm { function processDatamap_postProcessFieldArray ($status, $table, $id, &$fieldArray, &$reference) { // $table is the current table being processed // $id is the record's id (uid field) // $fieldArray has all the fields that have BEEN CHANGED, so not all the fields, just those that have been updated // $reference is a reference to the currently calling object, the object that calls this hook // In our case, let's write a simple example that checks for our table, and outputs the changed data to the screen, what // you do from here on, it depends on the desired functionality... // E-Mail Adressen $email_adressen ="email@test.de"; // Nachricht $messageNew = "Hello Username,\n\nThere are some new News.\n\nBest regards"; $messageUpdate = "Hello Username,\n\nThere are some changes on these News entry.\n\nBest regards"; // Falls Zeilen laenger als 70 Zeichen sind // E-Mail Absenderinformationen $from = "From: Test News-Information <noreply@test.de>"; $betreffNew = "Test News-Information"; $betreffUpdate = "Test News-Information"; if ($table == 'tt_news') { switch ($status) { case 'new': foreach($emails_in_array as $email) { } break; case 'update': foreach($emails_in_array as $email) { } break; } } } } ?>
Kann mir jemand sagen wie das geht? Bin noch der absolute Anfänger in Sachen Extensionentwicklung...
GLG