I'm trying to create a simple tokenized email that informs the author of a node when the latest revision of that node has been published as in the the documentation here: http://drupal.org/node/408968

Taking advantage of the pre-defined triggers of the Revisioning module and the various tokens of the Token module it is easy to have the system automatically send an email to the author of a revision when a moderator publishes, reverts or unpublishes it. Make sure that the core Trigger module is enabled on the Administer>>Site building>>Modules page. Then select an advanced action from the drop-down at Site configuration>>Actions, e.g. "Send tokenized e-mail", and configure it. A full list of all tokens available to you (given the modules you've enabled) appears when you click Placeholder tokens at the bottom of the page. Finally, attach your action to the relevant trigger (Site building>>Triggers>>Revisioning).

The problem is that only the global place holder tokens seem to work. It's as if the node and user placeholders won't render. Is this because the context is dealing with revisions, not nodes or is there some more arcane config that I might have missed that I require for the token actions mod?

Example of body of my tokenized email:

The following content (most rectent pending revision)
[nid]
has been published by [user-id].

Please email [user-mail] if there are any issues with this publication.

Thanks.

It is [site-date]

Thanx

Comments

rdeboer’s picture

I believe this is because in the case of an email, the 'user' and 'global' contexts get passed in a series of hook_token_values(..) calls but the 'node' context isn't. So the global and user-related placeholders work, but the node-related placeholders don't.
Help is on its way. The development snapshot of Revisioning 6.x-2.x-dev (18 May or later) has a fix that gets around the issue. It forces the Token Actions module to load both 'node' and 'user' contexts when publishing/reverting/unpublishing content, thus allowing you to use all 'global', 'user' and 'node'-related tokens, e.g. like so:

    Hello [author-name], 

    Moderator [user-name] has just approved and published revision #[vid] 
    of your [type-name] titled "[title]", found at [menu]: [menupath].

    Please email [user-name] ([user-mail]), if there are any issues with this publication.

    Regards,

    [site-name] [site-url] [site-slogan]
    [site-date]

Let us know if this works for you, so that we can include it in the next official release of Revisioning.

djipp11’s picture

Well, this seems to work fine. The tokenized emails are now useful - definitely include this!

What would be extra nice, if it's within the scope of the module, is to come up with a more conveneint way of commincating from editor to moderator, e.g. providing a link to a 'email web form' from the pending list that allows users to send all the pre-set tokenized information when they wish to inform a moderator of a ready-to-publish revision. The might need to be a text box for the editor to add additional comments and a feature to select a specific user form a list of moderators would be a boon. Just a suggestion.

Keep up the good work!

rdeboer’s picture

Good to hear it works for you djipp11!
Regarding the extended functionality.... you're not asking for much, are you? :-)
It's a great suggestion and one that I feel is applicable to contexts wider than just revision moderation.
So I don't think it's Revisioning's job to implement it, rather I see Revisioning and other modules leveraging of the functionality you propose living in a new module -- one that works closely with Token Actions no doubt. Or maybe something like this already exists?