0

I created a rule for that sends each product creator an email on the "Completing the checkout" event. The rule, component, and action all work, but I can't find the Customer Shipping Information tokens.

Can you provide insight or ideas on how I might get a token that would reveal the shipping information for my email? Below is my rule component and screenshots.

{ "rules_send_email_to_vendor" : {
"LABEL" : "Send email to vendor",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "Commerce Checkout" ],
"REQUIRES" : [ "rules", "commerce_checkout" ],
"ON" : { "commerce_checkout_complete" : [] },
"DO" : [
  { "LOOP" : {
      "USING" : { "list" : [ "commerce-order:commerce-line-items" ] },
      "ITEM" : { "list_item" : "Current list item" },
      "DO" : [
        { "component_rules_fetch_product_author" : { "line_id" : [ "list-item" ] } }
      ]
    }
  }
]
}
}

And below my rules screenshoot

Checkout has shipping information

Rule that loops through products and fires off emails

Component that fires off emails

List of tokens that don't show customer shipping

2

A couple of things, you actually have two rules:

  1. The first is the event rule that loops through the products
  2. The second is the component rule that fires off each email

Interesting side note, given your setup, you will likely be sending an email per product and not per product creator.

To get the shipping address in rules when you have access to an order entity, you simply need to add a condition "Entity has field" and check that the "line-id:order" has the customer's shipping profile field (by default this condition looks like this):

Select entity has field

Here's an animated gif displaying the process:

Process showing how to add the condition

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.