serendipity_event_mailer *my upgrade*

Creating and modifying plugins.
Post Reply
evanslee
Regular
Posts: 28
Joined: Tue Jul 27, 2010 3:21 pm

serendipity_event_mailer *my upgrade*

Post by evanslee »

Im using serendipity_event_mailer and have upgraded it's functionality,

Code: Select all

  <fieldset style="margin: 5px">
                        <legend><?php echo PLUGIN_EVENT_MAILER_NAME; ?></legend>
                            <input class="input_checkbox" type="checkbox" name="serendipity[properties][sendentry]" id="properties_sendentry" value="true" checked="checked" />
                            <label title="<?php echo PLUGIN_EVENT_MAILER_SENDING; ?>" for="properties_sendentry">&nbsp;<?php echo PLUGIN_EVENT_MAILER_ISTOSENDIT; ?></label><br />
                            <?php 
							$mails = serendipity_db_query("SELECT distinct realname,email FROM {$serendipity['dbPrefix']}authors group by realname, email");
                            foreach($mails AS $mail) {
								echo "<a href='#";
                                //echo trim($mail['email']);
								echo "' onClick=\"document.getElementById(";
								echo "'properties_mailto').value=document.getElementById('properties_mailto').value+' ";
								echo trim($mail['email']);
								echo "';this.style.color='red';return false\">";
								echo trim($mail['realname']);
								echo "</a>";
								echo ", ";
								
                            }
							 ?><br />

                            <label title="<?php echo PLUGIN_EVENT_MAILER_RECIPIENT; ?>" for="properties_mailto">&nbsp;<?php echo PLUGIN_EVENT_MAILER_RECIPIENTS; ?>&nbsp;&nbsp;</label>&nbsp;<br />

                            <input class="input_textbox" type="text" name="serendipity[properties][mailto]" id="properties_mailto" value="<?php echo htmlspecialchars($mailto); ?>" style="width: 100%" /><br />
                            <input type="checkbox" value="true" id="sendall" name="serendipity[properties][sendentry_all]" <?php echo ($sendtoall ? 'checked="checked"': ''); ?> />
                            <label title="<?php echo PLUGIN_EVENT_MAILER_SENDTOALL; ?>" for="sendall">&nbsp;<?php echo PLUGIN_EVENT_MAILER_SENDTOALL; ?></label>
                    </fieldset>
Added: ability to select author name from list (similar to the keyword tagging), this populates the email address in the recipient textbox allowing you to send to a few add-hoc recipients that are not in any predefined mailing lists, and where you dont want to send to all authors. Author name turns red after being added into the list of email addresses, so you can easily see who you have yet to mailto

Made the textbox 100% and added some formatting, to make it more like the tagging section... [probably should also match the font and size)

I have added the word DISTINCT to the sql as sometimes users create more than one account (however this wont make a difference if users have different 'realname', we should probably stop users from being able to create multiple accounts anyway...

Why is the seperator a space? its a comma in outlook, and a comma in serendipity for the addition of tags/keywords for example.... I havent changed it, but feel it should be changed to align...

Maybe I need to remove the first space from the textbox (or only put a space in if a value already exists in the textbox), still it doesnt hurt

Maybe need to make the text smaller?

Hope others can make use of my additions too

Lee
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: serendipity_event_mailer *my upgrade*

Post by garvinhicking »

Hi!

Thanks for sharing your improvements!

Indeed, a DISTINCT grouping makes sense as well as allowing to seperate mails with a "," instead of only with " ". (http://svn.berlios.de/wsvn/serendipity/ ... 4&peg=2734)

Your other changes are hard to isolate, can you provide a diff?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply