View Issue Details

IDProjectCategoryView StatusLast Update
0012515mantisbtfeaturepublic2010-11-08 03:13
Reportercas Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0012515: Simple script to send an additional email based upon status
Description

Simply schedule this script to run on a daily base and it will send grouped reminders to reporters whose issue has status feedback.
You can change thefeedback or run it just for one project simply by changing some values in the first section of the script.

Additional Information

For version 1.2.0 and above, you can use the reminder plugin

TagsNo tags attached.

Activities

cas

cas

2010-11-05 07:22

reporter  

bug_feedback_mail.zip (1,176 bytes)
dhx

dhx

2010-11-07 07:10

reporter   ~0027275

Good idea Cas!

Just some feedback to help you improve future patches/scripts/plugins:

Scripts such as this should be executed through the command line version of PHP. To prevent this file from being placed in the web root (where any user in the world can execute the script at will) you need to add a php_sapi_name() check as demonstrated in http://git.mantisbt.org/?p=mantisbt.git;a=blob;f=scripts/send_emails.php;h=ff3e81bac7dba82e4a98f15534322e38316cae75;hb=HEAD

Instead of using mysql functions from PHP, use the db functions from MantisBT to ensure that the script works for users running different database servers. Example: db_query_bound() instead of mysql_query().

RFC2822 section 2.1.1 (http://www.ietf.org/rfc/rfc2822.txt) limits the maximum number of characters per line in an email to 998 (not including the CR/LF at the end of each line). This would become an issue when sending long descriptions or bug notes to MantisBT users via email. This specification further recommends a maximum of 78 characters (not including CR/LF) per line in an email. AFAIK some of the MantisBT functions in email_api handle this for you, it's just a case of checking to ensure that the line length limitations are being adhered to.

The subject of the email you're sending could be more descriptive. Perhaps include (at a minimum) the bug tracker name so that people signed up to more than one bug tracker can distinguish between these daily digest emails?

Thanks for your continued development of plugins/scripts for MantisBT! Feel free to ask questions on the developer mailing list if you would like assistance at any point in time.

cas

cas

2010-11-08 03:08

reporter   ~0027282

Last edited: 2010-11-08 03:14

View 2 revisions

Thanks for the advice. Most of those are being practiced in the plugins.
This script was not adjusted since it was only there for older versions.
For version 1.2 and above one should use the plugin.
I will include the sapi check in the plugin, just to avoid someone is trying to execute them without any proper authorisation to do so.

Adjusted the script with the check and the generic db calls.

cas

cas

2010-11-08 03:13

reporter  

bug_feedback_mail2.zip (1,273 bytes)

Issue History

Date Modified Username Field Change
2010-11-05 07:22 cas New Issue
2010-11-05 07:22 cas File Added: bug_feedback_mail.zip
2010-11-07 07:10 dhx Note Added: 0027275
2010-11-08 03:08 cas Note Added: 0027282
2010-11-08 03:13 cas File Added: bug_feedback_mail2.zip
2010-11-08 03:14 cas Note Edited: 0027282 View Revisions