Version 1.0 ()
------------------------------------------------------------------------
+ * Entry mail plugin can now send mails to multiple recipients, and
+ define the list of recipients per-entry (garvinhicking)
+
* Trackback now uses PEAR HTTP::Request class to send trackbacks.
This allows to use HTTP redirects of trackbacks, which seem to
get more common nowadays (garvinhicking)
* Added option to turn off referrer tracking (garvinhicking)
- * Improved Smarty Plugin API so that a new function
+ * Improved Smarty Plugin API so that a new function
serendipity_fetchPrintEntries() can be used within a template to
print more entries, and abstracted _fetchEntries()/_printEntries()
calls a bit more so that future plugins can easier modify the
* Fix not being able to create users of the same userlevel when
being admin [workaround was to first create user with lower userlevel
- and then edit the user account, which lead to propper permission
+ and then edit the user account, which lead to propper permission
checks]
* Include a template's "config.inc.php" also when previewing an entry,
* Fix bug #1371630: Write permissions to category are stored with
input data of the 'Read permissions' author listing.
-
+
Version 0.9.1 (November 23rd, 2005)
------------------------------------------------------------------------
$propbag->add('name', PLUGIN_EVENT_MAILER_NAME);
$propbag->add('description', PLUGIN_EVENT_MAILER_DESC);
$propbag->add('stackable', false);
- $propbag->add('author', 'Sebastian Nohn, Kristian Köhntopp, Garvin Hicking');
- $propbag->add('version', '1.3');
+ $propbag->add('author', 'Sebastian Nohn, Kristian Koehntopp, Garvin Hicking');
+ $propbag->add('version', '1.4');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
'php' => '4.1.0'
));
$propbag->add('event_hooks', array(
- 'backend_publish' => true
+ 'backend_publish' => true,
+ 'backend_display' => true,
));
$propbag->add('groups', array('FRONTEND_ENTRY_RELATED'));
if (isset($hooks[$event])) {
switch($event) {
+ case 'backend_display':
+ if (isset($serendipity['POST']['properties']['mailto'])) {
+ $mailto = $serendipity['POST']['properties']['mailto'];
+ } else {
+ $mailto = $this->get_config('mailto');
+ }
+
+?>
+ <fieldset style="margin: 5px">
+ <legend><?php echo PLUGIN_EVENT_MAILER_NAME; ?></legend>
+ <label title="<?php echo PLUGIN_EVENT_MAILER_RECIPIENT; ?>" for="properties_mailto"> <?php echo PLUGIN_EVENT_MAILER_RECIPIENTS; ?> </label>
+ <input type="text" name="serendipity[properties][mailto]" id="properties_mailto" value="<?php echo htmlspecialchars($mailto); ?>" />
+ </fieldset>
+<?php
+ break;
+
case 'backend_publish':
+ $mails = explode(' ', $this->get_config('mailto'));
+ $to = array();
+ foreach($mails AS $mailto) {
+ $to[] = trim($mailto);
+ }
+
$mail = array(
- 'to' => $this->get_config('mailto'),
'subject' => $eventData['title'],
'body' => $eventData['body'] . $eventData['extended'],
// 'from' => $serendipity['blogTitle'] . ' - ' . $eventData['author'] . ' <' . $serendipity['serendipityEmail'] . '>'
'from' => $serendipity['serendipityEmail']
);
+ if (isset($serendipity['POST']['properties']['mailto'])) {
+ $mails = explode(' ', $serendipity['POST']['properties']['mailto']);
+ foreach($mails as $mailto) {
+ $mailto = trim($mailto);
+ if (!in_array($mailto, $to)) {
+ $to[] = $mailto;
+ }
+ }
+ }
+
if (serendipity_db_bool($this->get_config('convertp', false)) == true) {
$mail['body'] = str_replace('</p>', "</p>\n", $mail['body']);
}
$mail['body'] = serendipity_archiveURL($eventData['id'], $eventData['title'], 'baseURL', true, array('timestamp' => $eventData['timestamp'])) . "\n\n" . $mail['body'];
}
- serendipity_sendMail($mail['to'], $mail['subject'], $mail['body'], $mail['from']);
+ foreach($to AS $mailto) {
+ echo htmlspecialchars($mailto) . '...<br />';
+ serendipity_sendMail($mailto, $mail['subject'], $mail['body'], $mail['from']);
+ }
return true;
break;
}
/* vim: set sts=4 ts=4 expandtab : */
-?>