I'm trying to send an email on node change and i need to include site url and other tokens in email, but seems like it's not possible now.

CommentFileSizeAuthor
#8 2932325-8-site-tokens.patch24.68 KBtr
#7 2932325-7-site-tokens.patch23.88 KBtr

Comments

Anas_maw created an issue. See original summary.

roborew’s picture

We are also after this feature, ill do some digging.

tr’s picture

There is are no site tokens available in the D8 version of Rules yet. That feature still needs to be ported from D7.

I have an implementation that provides most site tokens as global context variables, but I don't think that direction is what @fago had in mind for core Rules, see #2245611: [META] Rules 8.x architecture. So I will eventually be providing that implementation as an add-on module for Rules rather than a patch for core Rules. Maybe sometime in the next month, after I have some time to finish it.

tr’s picture

Title: Site url token » Site tokens
Category: Feature request » Task
Priority: Normal » Major
Issue tags: +beta blocker

The site tokens were available in D7 but are not yet available in D8, so I consider this a porting task as opposed to a feature request.

I think it's important enough that this should be a beta blocker.

Syntapse’s picture

Does anyone have an idea when {{ site.stuff }} will be available?

tr’s picture

Issue tags: +D8RE

Tagging issues that will be fixed by code moved from D8RE.

tr’s picture

Status: Active » Needs review
StatusFileSize
new23.88 KB

This feature was developed in D8RE in the meta issue #3098286: [meta] Make site information available in D8
You can read that issue for documentation on how site tokens work in D8 compared to D7.

The attached patch moves that site token functionality from D8RE to Rules.

tr’s picture

StatusFileSize
new24.68 KB

This should fix the 3 coding standards problems, which only occur because core requires us to override and redefine the first parameter of \Drupal\Core\TypedData\TypedData::setValue() but doesn't give us a way to do that without completely replicating the documentation comments.

  • TR committed 5444d0f on 8.x-3.x
    Issue #2932325 by TR: Site tokens
    
tr’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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