As title says. We should be using the token module for the tag replacement in the email bodies. This will reduce the amount of code in comment_notify and increase the features for users.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

Version: 5.x-1.x-dev » 5.x-2.x-dev

This is surprisingly more complex than I thought. Some of the things we need don't have tokens. It will also take multiple calls to token_replace to get this done.

I'm tempted to postpone it and make it 6.x only...

greggles’s picture

Version: 5.x-2.x-dev » 7.x-1.x-dev

Yeah, 6.x only.

greggles’s picture

Title: Use token module for the email body » Use token module for the email body and subject

What the heck - subject too.

Dries’s picture

I'd like to get this module included into Drupal core. Creating a dependency on token module is likely to complicate that.

Looking at the code of this module, I don't see a strong need to use token module. The code is easy to read and understand as it is.

Freso’s picture

I know that's an old comment of yours, Dries, but IIRC, we came to the conclusion that we were going to work on getting Token into core as well? No? So that shouldn't be a problem anymore, should it? Quite the contrary, I would guess, as it would presumably lead to more code re-use.

greggles’s picture

Status: Active » Fixed

The 7.x version now uses tokens. I don't think it's worth backporting that.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

NancyDru’s picture

Status: Closed (fixed) » Active

Considering #595508 and #173979 for starters, I'd say there is interest other than mine for Tokens in 6.x.

We have a highly customized site that uses, amongst other modules, RealName and really need to use the RealName values in the email rather than the standard username (which is numeric, e.g. "967321", and therefore useless to the recipients).

If you did some prior work and still have it, I will be happy to try to finish it.

greggles’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

I don't have any work on this.

NancyDru’s picture

Okay.

webwriter’s picture

Subscribe for 6.x

YK85’s picture

subscribing - I'm kind of having trouble with title token as well.
I'm using node comments module and trying to show the title of the thread which the nodecomment is a comment of.
Thank you

greggles’s picture

Status: Active » Closed (works as designed)

I'm no longer adding features to the 6.x version and the 7.x version already has this.

anniegreens’s picture

For anyone who wants Realname support, or support for any other module that modifies theme_username, I've created a little patch for the D6 version similar to how support was added to the Print module (http://drupal.org/node/572848).

greggles’s picture

Status: Closed (works as designed) » Needs work

This looks close to me, but the check_plain seems inappropriate. For emails it's not neccessary/appropriate to escape html entities. If you can fix this I'd be happy to commit it.

greggles’s picture

Title: Use token module for the email body and subject » Provide realname support in the existing token system

Given that the purpose is different, updating title.

anniegreens’s picture

Attached is updated patch without check_plain.

greggles’s picture

Status: Needs work » Needs review

Thanks, anniegreens!

Anyone able to test?