View Issue Details

IDProjectCategoryView StatusLast Update
0012515mantisbtfeaturepublic2010-11-08 03:13
Reportercas Assigned To 
Status newResolutionopen 
Summary0012515: Simple script to send an additional email based upon status

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.




2010-11-05 07:22

reporter (1,176 bytes)


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;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 ( 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.



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.



2010-11-08 03:13

reporter (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:
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:
2010-11-08 03:14 cas Note Edited: 0027282 View Revisions