Reviewed & tested by the community
Project:
Variable Email
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
27 Aug 2012 at 19:12 UTC
Updated:
20 Jan 2018 at 11:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
roam2345 commentedIt looks like the patch that went into this module #1682730: Use standard rules token evaluation was dependant on the patch to rules #1547160: Support variable substitution in direct input mode which was rejected in-favour of #812058: add token support for non-entities basically putting back the changes from the path #1682730: Use standard rules token evaluation makes this function once again.
Comment #2
roam2345 commentedHere is a patch that does this.
Comment #3
roam2345 commentedSmall fix missing include.
Comment #4
summit commentedHi,
Is this patch also needed when you use Alpha1? It seems that Alpha1 is recommended to get Tokens instead of Token placeholders..
EDIT I think it is not needed for Aplha1, but for commerce-order:commerce-customer-billing it is not working, still only shows placeholder...
greetings, Martijn
Comment #5
shaneonabike commentedCONFIRMED this totally works and has literally saved me. Please apply this patch! No tokens were being applied properly until I applied this patch (it works in the correct languages too)
@Summit: Yes this is still a huge problem in Alpha1. I had it all working before but then it stopped working again which was super confusing for me.
@jucallme - THANKS so much this is totally saved the hair that remains on my head (half ripped out in wondering what the heck was going on)
PS - You had this set to documentation I changed it to code
Comment #6
akalata commentedThis patch got most of the required tokens working again (after #34 at #1559844: Field token is not replaced when fields are blank recommended upgrading from alpha1 to dev), but not the optional field tokens -- leaving me back where I started, but at least fixing the issue introduced by #1682730: Use standard rules token evaluation.
Comment #7
kevster commented@summit - this patch worked for me when applied to the dev version. I did try the other method of using message + mesage notify etc but still couldnt get the address tokens working and had HTML issues so reverted back to variable email + commerce email.
@akalata - this may fix your blank issue if you havent found a fix already?
@shaneonabike - using the dev introduced the blank field issue but adding this (taken from https://drupal.org/node/1559844 #34):
(apologies I havent learnt patching yet...)
after line 132 of variable_email.rules.inc (dev version) then fixes the blank tokens so doesnt print out the token name.
so you end up with:
This one has been driving me round the bend, Ive spent at least two days trying various module versions, patches and hacks. I still cant use the address tokens:
[commerce-order:commerce-customer-billing:commerce-customer-address] or
[commerce-order:commerce-customer-billing:commerce_customer_address]
[commerce-order:commerce-customer-shipping:commerce-customer-address] or
[commerce-order:commerce-customer-shipping:commerce_customer_address]
so have ended up having to pull in individual tokens e.g.
SHIP TO:
[commerce-order:commerce-customer-shipping:commerce-customer-address:name_line]
[commerce-order:commerce-customer-shipping:commerce-customer-address:first_name] [commerce-order:commerce-customer-shipping:commerce-customer-address:last_name]
[commerce-order:commerce-customer-shipping:commerce-customer-address:organisation_name]
[commerce-order:commerce-customer-shipping:commerce-customer-address:thoroughfare]
[commerce-order:commerce-customer-shipping:commerce-customer-address:administrative_area]
[commerce-order:commerce-customer-shipping:commerce-customer-address:locality]
[commerce-order:commerce-customer-shipping:commerce-customer-address:sub_locality], [commerce-order:commerce-customer-shipping:commerce-customer-address:postal_code]
[commerce-order:commerce-customer-shipping:commerce-customer-address:country]
but at least im getting tokens in the order email and blanks where no data...
Comment #8
lmeurs commented#3 so far works for me. This patch brings back code that was removed from the 7.x-1.0-alpha1 version (#1682730: Use standard rules token evaluation).
The patch probably needs another adjustment:
should become:
Comment #9
danny englanderI just applied the patch from #3 to the latest dev and am now getting this error resulting in a WSOD on the front end of my site:
Error: parse error in /sites/all/modules/contrib/variable_email/variable_email.rules.inc, line 147As far as I can tell the patch applied cleanly. The odd part is line 147 in the patched file is simply a blank line.
Comment #10
bradjones1Here's a patch which fixes the WSOD (missing } at end of file) as well as incorporates feedback from #8 and #7. Re-rolled against -dev and seems to work for me with token and rules -dev versions.
Comment #11
xurizaemonThe following two patches appear to reverse each other?
@highrockmedia, the patch in #3 here is missing a final
}. With that, you'd revert back to Variable Email with edb34a89 removed.I'm using that currently, but I suspect the proper fix is to identify why the change in edb34a89 doesn't apply to some actions (because
isset($element->settings['variable:process'])is not set for the emails I'm sending).I have to put this issue down now but hope to come back to it.
[EDIT: I see Brad was making patches while I was typing, nice one Brad!]
Comment #12
Frederic wbase commentedI can confirm that the path of bradjones in 10 is working like a charm, thanks for your work m8.
RTBC?
grts
Frederic
Comment #13
a.milkovsky#10 works, thank you!
Comment #14
4kant commented#10 is working.
Thanks!
Comment #15
drifter commentedAlso confirming that applying #10 makes tokens resolve again. Please commit.
Comment #16
giorgosk#10 solves tokens not replaced
please commit its already tested and reviewed by many
Comment #17
mr.york commentedReroll the patch.
Comment #18
geek-merlinAlso see https://www.drupal.org/project/variable_mimemail
Comment #19
denes.szabo commentedRe-rolled the patch to apply from the module's directory.