thorin/question_plugin — pull request #3 by C-Duv (2013-08-27 17:33:37+00:00)
Title: New feature: Can obfuscate name/address of asker/answerer and/or question/answer text in notifications (configurable option)

I've added a new feature: the ability to obfuscate name and address of _asker_ in question-asked notifications (also works for _answerer_ in question-answered notifications) and question's (or answer's) text.

The main goal for this it to avoid users not to answer questions via Redmine. Indeed, if they get questions and the name of the author in their e-mail software then can be tempted to reply via e-mail (by filling the correct e-mail address) or even by phone (in a company context). By compelling them to go to Redmine we are increasing the chances they use the "Update" link to answer.

#### Here is how it changes question notifications

###### Question asked (standard, no obfuscation):

> From: alice smith
> To: bob@someisp.tld
>
> --
> Question asked #42 alice smith
>
> Bob, what do you think of that?
>
> Issue #42: Wrong code there
> http://redmine.domain.tld/issues/42
>
> * Author: Redmine Admin
> * Status: New
> * Priority: Normal
>
> It looks like the test for SomeClass is missing some...

###### Question asked (name/address obfuscated):
> From: ~~alice smith~~ Redmine
> To: bob@someisp.tld
>
> --
> Question asked #42 ~~alice smith~~
>
> Bob, what do you think of that?
>
> Issue #42: Wrong code there
> http://redmine.domain.tld/issues/42
>
> * Author: Redmine Admin
> * Status: New
> * Priority: Normal
>
> It looks like the test for SomeClass is missing some...

###### Question asked (question's text obfuscated):
> From: alice smith
> To: bob@someisp.tld
>
> --
> Question asked #42 alice smith
>
> ~~Bob, what do you think of that?~~ Display question by clicking on the issue link below
>
> Issue #42: Wrong code there
> http://redmine.domain.tld/issues/42
>
> * Author: Redmine Admin
> * Status: New
> * Priority: Normal
>
> It looks like the test for SomeClass is missing some...

#### Here is how it changes answer notifications

###### Question answered (standard, no obfuscation):

> From: bob smith
> To: alice@internetmail.tld
>
> --
> <h1>Answer</h1>
> <p>I agree with OP.</p>
>
> <h1>Question</h1>
> <p>Bob, what do you think of that?</p>
>
> Issue #42: Wrong code there
> http://redmine.domain.tld/issues/42
>
> * Author: Redmine Admin
> * Status: New
> * Priority: Normal
>
> It looks like the test for SomeClass is missing some...

*(HTML tags are genuine, seems like a bug in "app\views\question_mailer\answered_question.text.erb")*

###### Question answered (name/address obfuscated):

> From: ~~bob smith~~ Redmine
> To: alice@internetmail.tld
>
> --
> <h1>Answer</h1>
> <p>I agree with OP.</p>
>
> <h1>Question</h1>
> <p>Bob, what do you think of that?</p>
>
> Issue #42: Wrong code there
> http://redmine.domain.tld/issues/42
>
> * Author: Redmine Admin
> * Status: New
> * Priority: Normal
>
> It looks like the test for SomeClass is missing some...

###### Question answered (answer's text obfuscated):

> From: bob smith
> To: alice@internetmail.tld
>
> --
> ~~<h1>Answer</h1>~~
> ~~<p>I agree with OP.</p>~~
> Your question has received an answer: click on the issue link below to display it
>
> <h1>Question</h1>
> <p>Bob, what do you think of that?</p>
>
> Issue #42: Wrong code there
> http://redmine.domain.tld/issues/42
>
> * Author: Redmine Admin
> * Status: New
> * Priority: Normal
>
> It looks like the test for SomeClass is missing some...

This feature is configurable via plugin's configuration panel (added `obfuscate_author` and `obfuscate_content` settings).