serendipity_event_mailer: (useful) addition
Posted: Thu Dec 22, 2005 10:52 pm
Hello,
I made an addition to s9y_event_mailer that I hope is useful. At the time of publishing new entry the user has no option to decide to send or not to send the entry via e-mail (the user may want to not send this particular entry ...). Now I added a checkbox in extended properties area, just before the edit control with the emails list that is checked by default. The user may, if he wants to, uncheck it and the entry will not be sent. Instead a message will be issued that informs the user that the entry was not sent, because he have decided so.
Here is the zip file with the changed files only, serendipity_event_mailer.php and lang_eng.inc.php.
The changes in serendipity_event_mailer.php are in function event_hook.
1) case 'backend_display':, additions to <fieldset> tag (first <input> and <label> pair):
2) case 'backend_publish': Added if statement that checks the value of the checkbox. The 'true' part simply emits a message that the entry was not sent and 'else' part contains the existing code, that sends the mail:
lang_en.inc.php contains three new strings.
I made an addition to s9y_event_mailer that I hope is useful. At the time of publishing new entry the user has no option to decide to send or not to send the entry via e-mail (the user may want to not send this particular entry ...). Now I added a checkbox in extended properties area, just before the edit control with the emails list that is checked by default. The user may, if he wants to, uncheck it and the entry will not be sent. Instead a message will be issued that informs the user that the entry was not sent, because he have decided so.
Here is the zip file with the changed files only, serendipity_event_mailer.php and lang_eng.inc.php.
The changes in serendipity_event_mailer.php are in function event_hook.
1) case 'backend_display':, additions to <fieldset> tag (first <input> and <label> pair):
Code: Select all
<fieldset style="margin: 5px">
<legend><?php echo PLUGIN_EVENT_MAILER_NAME; ?></legend>
<input type="checkbox" name="serendipity[properties][sendentry]" id="properties_sendentry" value="true" checked="checked" />
<label title="<?php echo PLUGIN_EVENT_MAILER_SENDING; ?>" for="properties_sendentry"> <?php echo PLUGIN_EVENT_MAILER_ISTOSENDIT; ?> </label><br />
<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>
Code: Select all
if ($serendipity['POST']['properties']['sendentry'] == false) {
echo PLUGIN_EVENT_MAILER_NOTSENDDECISION . '<br />';
} else {
...... sending email here ....
}
return true;