Forums » Development »
Customize Issue creation from incoming emails
Added by Federico Leverato over 7 years ago
Hello,
I have an email account which is used to collect incoming support requests. This account is then checked by redmine and new issues are created (or existing ones updated). The result is that all issues are created as coming from the same issuer/account, i.e. the email account which collects requests.
What I want is something different, of course. I'd like to have each issue created with the correct user from the start (creating new ones when not existing etc.).
So the first question is: how would you do that? Maybe I'm missing or mis-interpreting something. If so, please let me know.
Currently my idea is to intercept the "new issue creation" procedure and change that to do what I want: ignore the "from:" field and parse the email's content for the first "from:" occurrence there instead (being all forwarded messages).
So I found the row with this:
sender_email = email.from.to_a.first.to_s.stripin /app/models/mail_handler.rb
and thought this would be the correct point to "inject" my logic. But I'm pretty new to rails so please advice.
And - at the same time - I wonder if I can make a sort of clean override of this function, such that it could e.g. live as an independent file and also survive redmine updates.
thanks in advance for any input,
Federico
Replies (1)
RE: Customize Issue creation from incoming emails
-
Added by Mischa The Evil over 7 years ago
Federico, you might want to take a look at the unknown_user
option in the email setup. See RedmineReceivingEmails#Enabling-unknown-users-to-create-issues-by-email. There is no need to patch Redmine for this.