Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_mailer
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2819/plugins/serendipity_event_mailer
Modified Files:
serendipity_event_mailer.php
Log Message:
- Allow users to include the url to the article in the mail
- Allow users to remove html from the article before mailing it
Index: serendipity_event_mailer.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_mailer/serendipity_event_mailer.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- serendipity_event_mailer.php 3 Apr 2004 17:36:17 -0000 1.3
+++ serendipity_event_mailer.php 22 Jun 2004 09:44:50 -0000 1.4
@@ -6,6 +6,10 @@
@define('PLUGIN_EVENT_MAILER_DESC', 'Verschickt jeden neuen Artikel im Blog via E-Mail');
@define('PLUGIN_EVENT_MAILER_RECIPIENT', 'Mail-Empfänger');
@define('PLUGIN_EVENT_MAILER_RECIPIENTDESC', 'Die E-Mail Adresse an die die Artikel verschickt werden sollen (empfohlen: Eine Mailing-Liste)');
+ @define('PLUGIN_EVENT_MAILER_LINK', 'URL des Artikels mailen?');
+ @define('PLUGIN_EVENT_MAILER_LINKDESC', 'Verschickt die URL des Artikels.');
+ @define('PLUGIN_EVENT_MAILER_STRIPTAGS', 'HTML entfernen?');
+ @define('PLUGIN_EVENT_MAILER_STRIPTAGSDESC', 'Entfernt HTML-Anweisungen aus der Mail.');
break;
case 'en':
@@ -15,6 +19,10 @@
@define('PLUGIN_EVENT_MAILER_DESC', 'Mails each new entry to your blog via E-Mail');
@define('PLUGIN_EVENT_MAILER_RECIPIENT', 'Mail recipient');
@define('PLUGIN_EVENT_MAILER_RECIPIENTDESC', 'E-Mail address you want to send the entries to (suggested: a mailing list)');
+ @define('PLUGIN_EVENT_MAILER_LINK', 'Mail link to article?');
+ @define('PLUGIN_EVENT_MAILER_LINKDESC', 'Include a link to the article in the mail.');
+ @define('PLUGIN_EVENT_MAILER_STRIPTAGS', 'Remove HTML?');
+ @define('PLUGIN_EVENT_MAILER_STRIPTAGSDESC', 'Remove HTML-Tags from the mail.');
break;
}
@@ -30,7 +38,7 @@
'backend_publish' => true
));
- $propbag->add('configuration', array('mailto'));
+ $propbag->add('configuration', array('mailto', 'includelink', 'striptags'));
}
function introspect_config_item($name, &$propbag)
@@ -41,6 +49,16 @@
$propbag->add('name', PLUGIN_EVENT_MAILER_RECIPIENT);
$propbag->add('description', PLUGIN_EVENT_MAILER_RECIPIENTDESC);
break;
+ case 'includelink':
+ $propbag->add('type', 'boolean');
+ $propbag->add('name', PLUGIN_EVENT_MAILER_LINK);
+ $propbag->add('description', PLUGIN_EVENT_MAILER_LINKDESC);
+ break;
+ case 'striptags':
+ $propbag->add('type', 'boolean');
+ $propbag->add('name', PLUGIN_EVENT_MAILER_STRIPTAGS);
+ $propbag->add('description', PLUGIN_EVENT_MAILER_STRIPTAGSDESC);
+ break;
default:
break;
}
@@ -67,6 +85,12 @@
'from' => $serendipity['blogTitle'] . ' - ' . $eventData['author'] . ' <' . $serendipity['serendipityEmail'] . '>'
);
+ if($this->get_config('includelink') == true)
+ $mail['body'] = serendipity_archiveURL($eventData['id'], $eventData['title']) . "\n\n" . $mail['body'];
+
+ if($this->get_config('striptags') == true)
+ $mail['body'] = strip_tags($mail['body']);
+
mail($mail['to'], $mail['subject'], $mail['body'], "From: {$mail['from']}\r\n{$serendipity['mailheaders']}");
return true;
break;
|