markwhitfeld / redmine_incoming_emails

Redmine plugin that allows for the configuration of the default project on a per user basis for issues logged by email
GNU General Public License v2.0
2 stars 7 forks source link

read project from email subject #1

Open tofi86 opened 10 years ago

tofi86 commented 10 years ago

would it be possible to use the email subject to identify the project the mail should be added to? this would be more useful than just one project per user...

markwhitfeld commented 10 years ago

This would definitely be possible. This is a very simple plugin that just makes a small patch to the mail handler where it decides which project to use for the email. See (in this project): /lib/redmine_incoming_emails/patches/mail_handler_patch.rb The intent of the plugin is to allow for flexibility of the choice of project on a per user basis. So if you would like to contribute then you can make the changes and submit a pull request.

I would say that the best way to enable the feature you suggested would be to add an item to the per user drop down list on the configuration screen that says something like '(first word in subject line)' or '(in subject line)'. If this option is selected then, in the mail handler, you could check for this value and inspect the subject line to get the project name. I would also say that there should be some validation here with a fallback to the default project if a valid project could not be determined from the subject line.