eZ Publish 4.2 User module to get workflow triggers

The upcoming eZ Publish 4.2 (due September 29th) will add a bunch of workflow triggers to the user module. Workflows will be able to be attached to the following views:
This allows for custom workflow events to be run before and after each of these operations, resulting in a massive increase in the flexibility when interacting with users.

Some potential uses that come to mind:
  • Emailing users upon activation
  • Creating user specific content upon activation
  • Emailing users when they change their password
An effect of these changes is that code for these actions is isolated into a class allowing calls to be easily made from elsewhere. Prior to these changes to activate a user outside of the user/activate view you would have replicate code contained in the view. This will also make it easier to test.

I would have loved to see triggers added for login and logout but I suspect that would be a more involved exercise.

Unfortunately this enhancement did not make it into eZ Publish 4.2.0alpha1

SVN changes: http://pubsvn.ez.no/websvn2/revision.php?repname=nextgen&path=%2F&rev=23884
Changes were based on the enhancement request http://issues.ez.no/IssueView.php?Id=14882

Comments

  1. Note:
    "Emailing users upon activation"
    This is already possible in 4.1 and up using site.ini[UserSettings]VerifyUserType or RegistrationFeedback handlers (see settings/site.ini for details).
    But these overrides the default behavior so are more suited for use cases where you want totally custom activation/register email handling. For instance activation using SMS instead of email.

    ReplyDelete
  2. Thanks André - I'm finding a bunch of gems in 4.1 & 4.2 recently. Great to see generic hooks being added!

    ReplyDelete
  3. Yes, both 4.1 and 4.2 has had some nice minor additions:)
    Some others in 4.2 besides user triggers:
    - #15308: Add group_by support for extended attribute filters (as used by ezstarrating)
    - #15315: mysqli Persistent Connections support when using mysqlnd
    - #13044: attribute filter and sort by contentobject_id & node_id support

    ReplyDelete
  4. Hey Bruce,

    Thanks for the post. So pumped to see this as a new addition.

    According to the changelog this did in fact make it into 4.2, but I can't figure out for the life of me how to set up a workflow when a user activates his account. All I'm really trying to do is create a folder for the newly activated user that he can create content in.

    Do you know if there's any documentation anywhere on this? I don't see it in the workflow event dropdown to add it. Perhaps I'm missing something.

    ReplyDelete
  5. Hi Conrad

    As far as I'm aware there isn't any official documentation.

    Have a look at settings/workflow.ini - you'll have to uncomment out the required AvailableOperationList[] line to get the workflow event to appear in the list.

    Cheers
    Bruce

    ReplyDelete
  6. You are correct! Took me a little bit to come across it, but thanks for the pointers - I do see it now.

    I ended up actually going with a custom edit handler, but still good to know that this exists.

    Thanks again for the post.

    ReplyDelete

Post a Comment

Popular posts from this blog

eZ Publish Admin Prototype extension

eZ Publish Admin redesign - Dashboard = OpenSocial?

eZ Publish 5 Virtual Machine