when using a tokenized email such as the below, i am unable to produce the Node ID regularly in order to create the url of the node created. Sometimes [nid] returns the node ID and sometimes it is just blank.

A new [type-name] was created ([title]) by [author-name] ([site-url][account-url]).

[site-url]/node/[nid]

Comments

mudd’s picture

I'm struggling with something similar when firing off emails via workflow state transitions.

It appears that when a node is created or updated the token fails -- I get .../node/32
But when I submit I get a clean URL to the node. I've tried both [url] or [link] ("submit" is one of my workflow states -- by default all workflows have state "create", and that's where I'm having trouble). So my tokenized emails work fine from one state to another, except the "created" state. In fact, [link] gives me "[link]" in my email to some role but not to others.

This may be an issue with module weight.

greggles’s picture

Pathauto runs relatively late in the node creation process, so if you want to get the link your module will have to run after pathauto.

(See the weight in the system table).

dave reid’s picture

Component: Code » Token Actions
dave reid’s picture

Status: Active » Fixed

Answer provided in #2.

Status: Fixed » Closed (fixed)

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