2.4 Configuring Actions

Actions are the final piece of your completion rules — they define what happens when an order meets all your conditions. While Order Daemon’s primary action is completing orders, the system provides additional actions to enhance your automation workflow.

What Are Actions?

Actions are the “THEN” statements in your completion rules. After a trigger fires and all conditions are met, actions execute to:

  • Change the order status
  • Notify stakeholders
  • Add internal notes
  • Redirect customers
  • Integrate with other systems

Important: First Match Wins — Rules are evaluated by priority (menu_order). Only the first rule that matches will execute its actions; processing stops immediately afterward.

Core Action: Order Completion

The Primary Action

Every rule in Order Daemon includes the fundamental action:

Change Status to ‘Completed’

  • Changes order status to “Completed”
  • Triggers WooCommerce’s completion hooks
  • Sends customer notifications (if enabled)
  • Updates inventory and reports
  • Records detailed audit trail entry

This action is the default free action available to all users. It’s the core purpose of Order Daemon.

How Completion Works

1. Status Update
         ↓
2. WooCommerce Hooks Fire
         ↓
3. Email Notifications
         ↓
4. Audit Log Entry
         ↓
5. Additional Actions

Additional Actions

Free Actions

Change Status to ‘Completed’

Purpose: Mark the order as completed (default action)

Configuration:

  • No settings required
  • Always executes when rule conditions are met

Use cases:

  • Digital product delivery
  • Service order completion
  • Instant fulfillment scenarios

Example:

Automatically complete orders containing only virtual/downloadable products.

This is the only free action available and is included in every rule by default.

Premium Actions 🔓

Send Custom Email

Purpose: Send additional notifications beyond standard WooCommerce emails

Configuration:

  • Recipient: Customer, Site Administrator, or Custom Email Address
  • Email subject line (supports placeholders)
  • Email message content (supports placeholders)
  • Send as HTML option

Available Placeholders:

  • {order_number} – Order identifier
  • {customer_name} – Billing name
  • {order_total} – Formatted total
  • {order_date} – Order creation date
  • {order_status} – Current order status
  • {site_name} – WordPress site name
  • {site_url} – Site URL

Use cases:

  • Special instructions for digital products
  • VIP customer thank you messages
  • Admin notifications for high-value orders
  • Custom completion confirmations

Example setup:

Recipient: Customer
Subject: Your order #{order_number} is ready!
Message: 
  Hello {customer_name},
  
  Thank you for your order #{order_number}.
  Order Total: {order_total}
  Order Date: {order_date}
  
  Your digital products are now available for download.
  
  Best regards,
  {site_name} Team

Add Custom Order Note

Purpose: Add configurable notes to orders for documentation and communication

Configuration:

  • Note content (supports placeholders)
  • Privacy setting (Private/Customer-visible)
  • Note type (System/Customer/Internal)

Available Placeholders:

  • {order_number} – Order identifier
  • {order_id} – Order ID
  • {customer_name} – Billing name
  • {customer_email} – Customer email
  • {order_total} – Formatted total
  • {order_status} – Current status
  • {order_date} – Order creation date
  • {payment_method} – Payment method used
  • {shipping_method} – Shipping method
  • {site_name} – Site name
  • {current_date} – Current date
  • {current_time} – Current time

Use cases:

  • Document automation actions
  • Add processing instructions
  • Customer communication
  • Internal tracking

Example:

“Order auto-completed by rule. Customer: {customer_name}, Total: {order_total}, Payment: {payment_method}”

Change Status to ‘Processing’

Purpose: Set order status to “Processing” instead of “Completed”

Configuration:

  • No settings required
  • Alternative to completion for workflow integration

Use cases:

  • Route orders to fulfillment
  • Multi-step processing workflows
  • Custom status progression

Example:

Move orders to “Processing” for manual fulfillment while automating the initial approval.

Change Status to ‘On Hold’

Purpose: Set order status to “On Hold” for manual review

Configuration:

  • No settings required
  • Places orders in review queue

Use cases:

  • Flag orders for manual verification
  • Fraud prevention workflows
  • Special handling requirements

Example:

Place high-value orders “On Hold” for additional verification before completion.

Configuring Actions

In the Rule Builder

  1. Navigate to Order Daemon → Completion Rules
  2. Edit your rule or create new
  3. Locate the Actions section (below Conditions)
  4. Enable desired additional actions
  5. Configure each action’s settings
  6. Preview action output where available
  7. Save your rule

Action Execution Order

Actions execute in a specific sequence:

  1. Order Status Update (always first)
  2. Order Notes (internal tracking)
  3. Customer Notes (visible communication)
  4. Email Notifications (custom messages)
  5. Webhooks (external systems)
  6. Redirects (always last)

This order ensures data consistency and proper notification flow.

Action Templates & Variables

Available Variables

Use these in any text field:

Order Data:

  • {order_id} – Unique order ID
  • {order_number} – Display number
  • {order_key} – Order key used in return/thank-you URLs
  • {order_total} – Formatted total
  • {order_date} – Order creation date
  • {order_status} – Current status
  • {payment_method} – Payment gateway ID/label

Customer Data:

  • {customer_email} – Billing email
  • {customer_name} – Full billing name
  • {customer_first_name} – First name only
  • {customer_phone} – Billing phone

Product Data:

  • {product_names} – Comma-separated list
  • {product_count} – Number of items
  • {download_links} – For downloadable products

System Data:

  • {site_name} – WordPress site title
  • {admin_email} – Admin email address
  • {rule_name} – Triggering rule name
  • {completion_date} – Current date/time

Template Examples

VIP Thank You Email

Subject: VIP Order Confirmed - {order_number}

Hi {customer_first_name},

Thank you for your order of {product_names}!

As a valued VIP customer, your order has been fast-tracked 
and completed immediately. 

Order Total: {order_total}
Order Date: {order_date}

Your VIP benefits include:
- Priority support
- Exclusive discounts
- Early access to new products

Best regards,
{site_name} Team

Webhook Payload

{
  "event": "order_completed",
  "timestamp": "{completion_date}",
  "order": {
    "id": "{order_id}",
    "number": "{order_number}",
    "total": "{order_total}",
    "items": "{product_count}"
  },
  "customer": {
    "email": "{customer_email}",
    "name": "{customer_name}"
  },
  "automation": {
    "rule": "{rule_name}",
    "plugin": "order_daemon"
  }
}

Advanced Action Configuration

Conditional Action Logic

While actions always execute when conditions match, you can build smart logic:

Example: Tiered Customer Communication

  • Rule 1 (Orders < $50): Basic thank you note
  • Rule 2 (Orders $50-$200): Include discount code
  • Rule 3 (Orders > $200): VIP welcome package

Action Combinations

Powerful workflows using multiple actions:

Digital Course Delivery:

  • ✅ Complete order
  • ✅ Add note: “Course access granted”
  • ✅ Send email with login credentials
  • ✅ Redirect to course platform
  • ✅ Webhook to LMS for enrollment

B2B Order Processing:

  • ✅ Complete order
  • ✅ Add note with PO number
  • ✅ Email accounts receivable
  • ✅ Webhook to ERP system
  • ✅ Customer note about NET terms

Testing Actions

Safe Testing Methods

  1. Test Mode
    – Enable test mode in rule settings
    – Actions log but don’t execute
    – Review what would happen
  2. Staging Environment
    – Test full action execution
    – Verify emails and webhooks
    – Check customer experience
  3. Test Orders
    – Create manual test orders
    – Use test payment methods
    – Verify each action fires

Action Debugging

Check Audit Logs:

  • Each action execution is logged
  • Success/failure status recorded
  • Error messages for troubleshooting

Common Issues:

  • Email delivery failures → Check SMTP settings
  • Webhook timeouts → Verify endpoint availability
  • Redirect loops → Check URL parameters
  • Variable rendering → Ensure data exists

Best Practices

Do’s

  • ✅ Test email templates before activating
  • ✅ Use meaningful order notes
  • ✅ Validate webhook endpoints
  • ✅ Keep customer communications clear
  • ✅ Monitor action performance

Don’ts

  • ❌ Don’t send too many emails
  • ❌ Avoid sensitive data in webhooks
  • ❌ Don’t redirect to broken pages
  • ❌ Never skip testing actions
  • ❌ Avoid complex HTML in emails

Performance Considerations

Action Impact

Different actions have different performance impacts:

Lightweight:

  • Order notes (database write)
  • Status updates (native WooCommerce)

Medium:

  • Email sending (SMTP connection)
  • Customer notes (may trigger emails)

Heavy:

  • Webhooks (external HTTP requests)
  • Complex email templates
  • Multiple simultaneous actions

Optimization Tips

  1. Batch Similar Actions: Combine notes rather than multiple entries
  2. Async Webhooks: Use queued processing for non-critical webhooks
  3. Email Efficiency: Use transactional email services
  4. Conditional Logic: Only run necessary actions

Extending Actions

Custom Actions (Developer)

Register custom actions:

add_filter('odcm_custom_actions', function($actions) {
    $actions['sms_notification'] = [
        'label' => 'Send SMS',
        'callback' => 'send_order_sms',
        'fields' => ['phone_number', 'message']
    ];
    return $actions;
});

Action Hooks

Extend existing actions:

// After order completion
add_action('odcm_after_order_completed', function($order_id, $rule_id) {
    // Custom processing
}, 10, 2);

// Modify email content
add_filter('odcm_custom_email_content', function($content, $order) {
    // Add dynamic content
    return $content;
}, 10, 2);

Next Steps

With actions configured, you’re ready to:

  • Test your order rules
  • Monitor action execution
  • Troubleshoot any issues

Remember: Actions are powerful tools that directly impact your customers. Always test thoroughly and start with simple configurations before building complex automation workflows.

Was this article helpful?

  • Loading...
Table of Contents
  • Loading...