Tech:Email

[Edit]Overview

There are a few points on the roadmap concerning email support.

  • Send user an email after registration to activate his account. Roadmap#Email Support
  • Send user an email when he has forgotten his email. He gets a link, where he can enter new password. ForgottenPassword
  • Email notification when topic is updated.

Instead of notifications about changes, users should use RSS feeds.

The email component needs this information:

  • Address of SMTP server
  • Port of SMTP server
  • Account on server
  • Password for account
  • Reply address

Configuration should be done during setup process and optional on an administrator page.

Existing code:

org.jamwiki.WikiMail.sendMail(String from, String to, String subject, String body)

[Edit]Description

[Edit]EmailService

  • Send email and creates validation codes. √
EmailUserService
  String sendActivationLink(...); // called from RegisterServlet
  String userForgotPassword(...); //called from LoginServlet
    

[Edit]EmailServlet

Called by links in emails.

  • add page with textfield to enter validation code //Not implemented yet
  • accepts calls to activate user √
  • accepts calss to reset password √
  • 3 Parameters 'action' and 'code' and 'user'. Action can be 'registration' or 'reset'. 'code' contains validation code and user the username.

[Edit]RegisterServlet

  • Checks if email support is activated and sends email. √
  • Shows page with information to check email. √

[Edit]LoginServlet

  • Add Button in LoginServlet beside password field to request password reset. √

[Edit]TopicChangedListener

  • add interface, which should be informed about all topic changes.
TopicChangedListener
  void topicChanged(Topic topic);
  • Not implemented yet

[Edit]AdminServlet

  • add configuration for email server √

[Edit]Database

  • Add columns "enabled" and "validationCode" to WIKI_USER. √
  • Update of create/select/update/insert statements √

[Edit]Screenshots

After Registration

New login page
Request new password
After request
After following link fo entering new password
Confirmation that password has changed

[Edit]Comments

A couple of quick comments:

  • First, it's awesome that someone is looking into email capabilities as that's one of the more highly requested features, but I've not done any investigation, mostly due to being too lazy to install a mail server.
  • Second, it would probably be better if all mail settings were configured only from Special:Admin and not from Special:Setup - I'd like to limit setup to the bare minimum necessary to get a system up and running. Additionally, quick & easy setup is one of JAMWiki's selling points :)
  • Finally, it would be cool if this was implemented in a generic enough way that we could easily allow email notifications when topics are updated. The company I'm working at now has requested that since people use email much more than they do RSS readers. That feature doesn't need to be made available immediately, but it would be good if it was easy to implement later.

Thanks again for getting this started! -- Ryan 23-Jul-2007 08:51 PDT

What's the difference between WikiUser and WikiUserInfo? They contain almost the same information. Mike 25-Jul-2007 11:17 PDT

The original idea was the WikiUser and WikiUserInfo would provide a way to allow external systems like LDAP to be used since the WikiUserInfo object would contain fields that weren't JAMWiki-specific and might be stored elsewhere. As the authentication & authorization system has evolved I'm not sure if that distinction has been maintained. The major to-do item for 0.6.0 is a re-work of the authorization rules, and auditing to cleanup anything that's no longer correct might make sense as well. -- Ryan 25-Jul-2007 11:28 PDT

Where should email settings be on AdminServlet? After Parser settings? Mike 25-Jul-2007 16:34 PDT

I'm not great with UI - obviously - so I'll defer to your opinion and those of others who have better aesthetic sense than my own. That said, putting it after parser settings makes sense since the "general" and "parser" settings are more likely to be updated than email settings, while database and LDAP settings probably won't need to be modified at all once a wiki is set up. -- Ryan 25-Jul-2007 16:42 PDT

Is there a way to get an absolute link to the wiki or a servlet eg. http://jamwiki.org/wiki or http://jamwiki.org/wiki/en/Special:EmailValidation Mike 26-Jul-2007 05:46 PDT

I know I can get the current servlet url from the ServletRequest object. But is it possible from outside an servlet? Mike 26-Jul-2007 08:19 PDT
Can you provide an example of where you would want to use this functionality? I believe Spring may offer some utility methods for pulling site information, but most of the time I think you should have a ServletRequest available. -- Ryan 26-Jul-2007 08:56 PDT

[Edit]Progress

After my holidays I have committed some code to my branch mikegremi. There is are configuration setting for email on the Admin page and sending email with activation link and forgotten password are supported. To test just check out my branch, go to /jamwiki and run 'mvn jetty:run'. I would like to merge in to trunk after the next release. Mike 20-Aug-2007 23:31 PDT

I haven't had a chance to look through everything you've done in detail, but what I've seen definitely looks reasonable. It looks like the 0.6.0 may get pushed back another week or so due to some newly reported bugs, but hopefully thereafter work can start on 0.6.1 (or possibly 0.7.0, depending on the number of changes). Hopefully that won't be too long to wait! -- Ryan 20-Aug-2007 23:57 PDT

[Edit]June 2008 Update

This code has not yet been merged to trunk, but there is significant interest in adding email alerts and other email integration, so it looks like may be revived for the 0.7.0 release cycle. I haven't yet reviewed Mike's code or design, and he has unfortunately gone missing, but it will most likely be the starting point for any implementation that is created. -- Ryan 04-Jun-2008 22:00 PDT

Can we get this into the Roadmap? It's a killer feature in a project environment. Email is more push than rss. -- Antony Stubbs 25-Jun-2008 19:51 PDT