Discussions

How to get access to variables

I am trying to setup notifications for my store. I have followed a screencast (http://www.drupalcommerce.org/discussions/2493/checkout-rule-send-email-...) here that described how to add a custom email field to a product, then reference that value in a loop inside a checkout rule, to send emails when a product has been sold. These "vendor" notifications are working great. However, I cannot bring in any shipping information. I want to use this to let a drop shipper know an order was placed and where to send it to.
I made a change to the original setup in that I have installed/enabled the commerce_email module to handle mail. I am currently using the admin template for these "vendor" notifications. Note that I also could not get shipping information before changing to commerce_email. When the normal checkout email to administrator fires, I am getting shipping information. When my "vendor" notifications fire, all I get is the variable names.
My understanding of this issue is that in the latter case, I do not have a reference to the commerce_shipping variable for the current order. I have tried adding rules with entity-has-field (lots of diff things) in order to bring in the reference, but can't figure it out.
Can anyone suggest how I can get a reference to my shipping information in my "vendor" notifications?

Posted: Sep 24, 2012

Comments

lmatthews on September 24, 2012

I have added an action to Fetch an Entity. I named it order-fetched.
In the Administrator template, I can get my shipping information by referencing it by [order-fetched:order-id...etc.]
Now the problem is that I do not get the information in the regular Administrator email at checkout since I'm using the same email template for both types of notifications.
I really need to be able to create a separate template for the "vendor" emails now that I can get the data I need.
On to figure that out next.