There is information about rules data selectors when using the data selection mode but there is no information on using token module tokens when in direct input mode.

It would be nice to have help text in direct input mode that mentions that you can use tokens and that has a token tree of available tokens.

Comments

rooby created an issue. See original summary.

rooby’s picture

Title: Global tokens don't display in data selection autocomplete » Add token information when using direct input mode
Component: Rules Core » User Interface
Category: Bug report » Feature request

I realised after creating this that the rules data selector uses a separate system to token module tokens, but that you can use token module tokens in direct input mode.

It would be nice to have help text in direct input mode that mentions that you can use tokens and that has a token tree of available tokens.

rooby’s picture

Issue summary: View changes
namwebs’s picture

you can use token module tokens in direct input mode

How? I can't get token module tokens to work at all...

rooby’s picture

@namwebs
This was a while ago and I don't have admin access to that specific site anymore but I'm pretty sure I was using rules to send HTML emails (via the mimemail module) and I was using regular Drupal tokens in the subject and body fields of the email.

It's possible that is something that mimemail implements (running that text through the tokeniser) and that other rules actions and conditions don't do it by default.

namwebs’s picture

Thanks @rooby. I will look into that.

tr’s picture

Mime Mail in Drupal 8 does not yet support Rules - none of that code has been ported from D7. So there is no special "Send HTML e-mail" action provided by Mime Mail like there was in D7.

Rules in D8 does not support Token module tokens. However, if you code your own conditions/actions you may implement your own Token module token replacement on the values passed into your conditions/actions.

namwebs’s picture

Thanks.

A solution which works for me is to use D8 Rules to redirect to a page which uses Views Send to send mail. Views Send does support token module tokens so this combo gives good flexibility.

rooby’s picture

Ah yes, I was definitely using Drupal 7 when I created this issue. It's possible I created it as a D8 issue accidentally or due to new features going into D8 first.

fago’s picture

Status: Active » Closed (duplicate)
rooby’s picture

@fago, that's this issue.

mpotter’s picture

Status: Closed (duplicate) » Active

In #10, you closed as Dup, but referenced this same issue. If there is a different issue that is the main issue, post it here and re-close this. Otherwise re-opening this.

tr’s picture

Status: Active » Closed (duplicate)

Let's mark this as duplicate of #2850198: Twig-style tokens and data selection autocomplete are confusing, because that other issue has a far better issue summary and task list for addressing this problem.

deepak_mishra’s picture

I want to send an email, i created rules but in rules i am not able to get the token or replacement pattern.