ATM, the notification is easy to use but not very flexible. You can pre-configure notification messages, use the
<not:notification> templates in your forms, and the messages are sent automatically (you don't have to care for them in your usecase implementation).

I think a Java component would be more suitable for this task, maybe alongside with predefined forms:

Notifier notifier = (Notifier) manager.lookup(Notifier.ROLE);
notifier.useConfiguration(ThisUseCase.USECASE_NAME);
notifier.addMessage("Resource was published: " + resource.getUrl());

WorkflowVersion version = resource.getWorkflow().getLastVersion("submit");
User submitter = version.getExecutor();
notifier.addRecipient(submitter); 

...

notifier.send();

Some "automagic" might be useful:

  • There is a config file for notification (as it is now).
  • We define some request parameter names:
    • lenya.notification.to
    • lenya.notification.message

GregorRothfuss : what would the to refer to? users and / or groups?

  • The notifier checks the request for these parameters and
    uses them to override the configuration options.

Maybe it would make sense to use Lenya users instead of plain e-mail addresses for notification. Then the notification type (mail, IM, SMS, ...) could be configured, maybe even by the recipients.

GregorRothfuss : I agree. The email address is an implementation detail and it would make sense to hide it. How is emailing a group handled? Individual emails to all group members?

  • No labels