Need help in "how to give token value on form submission"..?

Events happening in the community are now at Drupal community events on www.drupal.org.
tarun_nagpal's picture

Hello There,
I am facing a simple but strange issue.

I have a node form and i want a token that have the node URL that is being submitted/created. I want to send a thank you message to the user along with the node link.

I have created a custom token using hook_token_info (https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...) and given the value using hook_tokens (https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func... ). But, i am unable to change/assign the value of the token at node_form_submit.

The last option is to use the str_replace (http://php.net/manual/en/function.str-replace.php) function of PHP. But i do not want to do it in a dirty manner.

Any Idea how to achieve this.?

Thanks and Regards
Tarun Nagpal

Comments

Use rules module

rakesh.gectcr's picture

Use rules module

Rakesh James

Use hook_node_insert/update

sarath.rajan's picture

Use hook_node_insert/update function to send the email to the author. node url is simply - node/*, replace * with node id.

Thanks I will try this

tarun_nagpal's picture

Thanks I will try this.

India

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: