Hi, I seem to have several tokens not working well.

Here is the result of one tokenized email:

A new comment has been posted by administrator on [title-raw]. Posted
08-Jul-26. Node: [nid] Comment
subject: here is another comment Comment body:
here is another comment

Neither [title], nor [title-raw] nor [nid] get replaced. Also, despite including carriage returns in various places, they aren't included in the email that is sent.

Here is the result of a second tokenized email:

A new user just registered. User: [user] Registration date: [reg-date]

Using dev build from July 23rd.

Can't wait to have these working :-)

CommentFileSizeAuthor
#2 287614_node_tokens_for_comments.patch996 bytesgreggles
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mariomaric’s picture

Hi.

I don't know for first tokenized mail, but you should try with last one with something like this:

A new user just registered. User: [user-name] Registration date: [site-date]

Point is to use global tokens instead of...non-global? :)

Cheers.

greggles’s picture

Title: Various non-working tokens + bad formatting » support node tokens when a comment is posted in "send tokenized e-mail"
Component: Code » Token Actions
Category: bug » feature
Status: Active » Needs review
FileSize
996 bytes

I think that mariomaric is correct. Currently the only tokens that have a chance to work for "send tokenized e-mail" in response to a comment are 1) comment tokens 2) global tokens.

So, we can turn this into a feature request so that token actions will support node tokens about the node that was commented on when a comment is submitted.

I've created an (untested) patch that I believe should work. Could you please test it out?

mooffie’s picture

This is a duplicate of #306324: Node tokens not working for comment actions. That other issue contains a patch virtually identical to yours, greggles, but a bit more elegant (because it factors out the context's "fix up" and thus affects the "Show Tokenized Message" action too).

I'd say we should mark this issue as "duplicate" and commit the patch attached to that other issue because it was tested by three people already.

mooffie’s picture

Also, despite including carriage returns in various places, they aren't included in the email that is sent

This is an unrelated bug. You should file a separate issue.

greggles’s picture

Status: Needs review » Closed (duplicate)

Agreed with moofie - marking as a duplicate of #306324: Node tokens not working for comment actions.