Bug 403261 - Allow overriding of email templates
Summary: Allow overriding of email templates
Status: REOPENED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Server (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted, triaged
Depends on:
Blocks:
 
Reported: 2013-03-13 15:53 EDT by Javier Pedemonte CLA
Modified: 2017-01-25 11:33 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Javier Pedemonte CLA 2013-03-13 15:53:36 EDT
For the purposes of integration and/or branding, it would be nice to be able to override the email templates used by Orion (in org.eclipse.orion.server.useradmin/emails).  Currently, the only way to handle this is to replace the files in the useradmin plugin itself.
Comment 1 John Arthorne CLA 2015-05-05 14:37:00 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html
Comment 2 Rafael Chaves CLA 2015-05-22 09:01:23 EDT
I was about to submit the same request. UserEmailUtil.java currently requires the email templates to be in the bundle itself.

http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/tree/bundles/org.eclipse.orion.server.useradmin/src/org/eclipse/orion/server/useradmin/UserEmailUtil.java?id=443083a9afc055f8201bae01c7a1297fb914153b
Comment 3 Carolyn MacLeod CLA 2015-05-22 10:58:27 EDT
Rafael or Javier, can you give an example of what you would override?
Comment 4 Rafael Chaves CLA 2015-05-22 11:02:35 EDT
Carolyn, in my case it would be the email message body, and the subject string (for example, the email confirmation message has as subject: "Confirm your email address for Orion" - my users do not necessarily know my project is built on Orion).
Comment 5 Rafael Chaves CLA 2015-05-27 19:09:04 EDT
See also: https://github.com/maqetta/maqetta/issues/3846
Comment 6 John Arthorne CLA 2016-01-05 11:56:24 EST
I took a quick look at this, and I think a simple solution could be done as follows:

 - Have a server configuration property for the product name
 - Have a template variable in the email contents that is replaced with the product name


There are already similar variable substitutions that occur to copy here. The class that does the substitutions is: org.eclipse.orion.internal.server.servlets.useradmin.UserEmailUtil

And the email contents are found here:

http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/tree/bundles/org.eclipse.orion.server.servlets/emails

This would be an easy 30+ minute work item for a bug day or student project. Of course a more complete solution would allow for completely customized messages, but that is a bit more work if someone is willing to dig into it.
Comment 7 John Arthorne CLA 2016-01-05 12:00:56 EST
I also removed some gratuitous uses of the word "orion" from the confirmation messages:

http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=f69b2ebd88fdd1fa6500f3d825d02a064a590882
Comment 8 Steve Northover CLA 2016-01-15 14:15:53 EST
Paul, do you want to give this to a student.
Comment 9 Paul Webster CLA 2016-01-20 09:05:42 EST
(In reply to Steve Northover from comment #8)
> Paul, do you want to give this to a student.

Yes, I think so.
Comment 10 Michael Rennie CLA 2017-01-10 15:36:56 EST
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg04002.html
Comment 11 Rafael Chaves CLA 2017-01-11 13:47:45 EST
Reopening as suggested.
Comment 12 Steve Northover CLA 2017-01-24 16:39:09 EST
Rafeal, would documenting this be enough?
Comment 13 Rafael Chaves CLA 2017-01-24 19:23:20 EST
Steve, do you mean there is already a way of customizing things and it just isn't documented yet? Yes, that would be great!

Anything that allows the email templates to be customized without having to change the code/files shipped in Orion itself would be good. Last time I checked the strings I needed to replace were hardcoded into the code (or internal resource files).
Comment 14 Steve Northover CLA 2017-01-25 11:33:47 EST
I meant documenting the string changes.  A mechanism does not exist and it is unlikely we will get to this bug.

Please submit a patch and we will take a look at it.