Following this old checkout_pane_example.module tutorial, I created a custom Drupal 7 Commerce checkout pane. It's simply a text field to collect special order instructions from the customer.
function checkout_pane_example_pane_checkout_form($form, &$form_state, $checkout_pane, $order) {
$pane_form['nickname'] = array(
'#type' => 'textfield',
'#title' => t('Your nickname'),
'#description' => t("We'd like to call you by your nickname."),
'#default_value' => !empty($order->data['nickname']) ? $order->data['nickname'] : '',
'#required' => TRUE,
);
return $pane_form;
}
The pane works fine. Anything that's saved in the text area is then stored in $order->data['nickname']
.
The problem is that I need to access the data in Rules so I can attach it to the existing email that's sent out on order completion email.
How can I access or expose that data via the Rules module?