shopp('purchase.email-event')

Display a property of the order event that triggered the current email notification.

shopp('purchase', 'email-event', 'options')

@param string $object the object or object.tag combination, if object.tag is used, the tag parameter can be omitted
@param string $tag the tag, can be hyphenated or not. Prefix with 'get' as shorthand for the return=true option
@param mixed $options associative array, or url-style name=value pairs separated by ampersands (&). Each pair is passed to the theme api tag as an option.
@returns void by default, the specified event property when the return option is used.

Alternative Forms

shopp('purchase.email-event', 'options...');

Description

Display a property of the order event that triggered the current email notification.

Order Event notification emails will only be sent if the email template for the order event has been created in the form of email-{event name}.php for the customer, or email-{event name}-merchant.php for the merchant. For example, to send notification emails for the refunded order event, you would create a theme template named email-refunded.php for email notifications going to the customer, and email-refunded-merchant.php for email notifications going to the merchant.

Note:
In addition to the above notification emails for all order events, there is a standard notification email that occurs at the time when the initial payment authorization or payment capture occurs (depending on whether the purchase was set for authorize only, or complete sale), causing the shopp_order_notifications action.

Standard order notification emails are handled by either the email-order.php, order.php, or order.html templates for the customer email (first found in that order), or the email-order-merchant.php, email-order.php, order.php, or order.html email template (first found in that order) for the merchant email. There is no order event context set for these standard notifications.

Universal Options

All Theme API calls have these options.

  • return: when set to true, 1, or on, this option forces the tag to return the value instead of displaying/echoing the value to the page. Alternatively, prefix the tag parameter with get to get the same effect. All theme api tags that return a boolean value will return by default.
  • echo: when set to false, 0, or off, this option forces the tag to display the value to the page. This is the default for all non-boolean tags.
  • is: when set to true, 1, or on, this option will evaluate the return of the theme api call as a boolean true or false value. See how values are converted to boolean.

Options

  • name: the name of the desired event object property you wish to display in the email.

Any property of the event object can be selected by setting the name option to the desired property name the tag options.

These properties include but are not limited to the following:

  • name: selects the event object name, such as purchase, authed, captured, shipped, refunded, etc.
  • gateway: selects the payment gateway module name responsible for the event.
  • order: selects the purchase order number when the event is for a created purchase order (all events after purchase order creation).
  • txnid: selects the transaction id of the event when the event should have a transaction id associated with it, in some cases as early as the purchase event, and typically for merchant initiated actions, such as refund, void, and capture from the Order manager, as well as from the gateway authed, captured, refunded, voided.
  • txnorigin: selects the original transaction id when set on events such as recaptured and voided.
  • amount: selects the event amount when the event should have an amount associated with it, such as events invoice, auth, sale, capture, authed, rebill, captured, recaptured, refund, refunded, amt-voided, auth-fail, capture-fail, recapture-fail, refund-fail, etc.
  • fees: selects the transactional fee amount, if provided, that a payment processor will take from a transaction, on order events authed, rebill, and captured.
  • paymethod: select the payment module’s merchant defined label for events authed or rebill.
  • paytype: select the payment type, such as check, MasterCard, etc for events authed or rebill.
  • payid: select the last for digits of the payment card or check number for events authed or rebill.
  • error: select the error code associated with a fail event, such as auth-fail, capture-fail, recapture-fail, refund-fail, or void-fail.
  • user: selects the WordPress user ID that issued the event from the Order manager, for events such as notice, refund, void, decrypt (Manual Processing), and capture.
  • note: selects the message logged by a user from Order manager, on events notice and void, and transaction review messages from the payment module on review events.
  • kind: selects the review message kind for a review event.
  • reason: selects the reason code for a refund or void event.
  • message: select the error message associated with a fail event, such as auth-fail, capture-fail, recapture-fail, refund-fail, or void-fail.
  • tracking: select the tracking number for a shipped order event.
  • carrier: select the carrier name for a shipped order event.
  • purchased: select the purchased item id for a download order event.
  • download: select the download id for a download order event.
  • ip: select the IP address for a download order event.
  • customer: select the customer id for a download order event.

Examples

// get the event name
$name = shopp('purchase', 'email-event', 'name=name&return=on');

if ( 'purchase' == $name ) {
// email content only for purchase order events
}
// display the gateway module name in the email
shopp('purchase','email-event','name=gateway');
// display the order number of the event in the email
shopp('purchase','email-event','name=order');

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar