Orange Collar Media
Orange Collar Media
DOCS
OCMLABS/MODULE-PRODUCT-MESSAGING · TROUBLESHOOTING

Troubleshooting emails that never send, rules that do not match, and missing blocks

  • Magento
  • Adobe Commerce
  • Hyvä

Emails stay Pending in the Email Log

Almost always cron. Queuing works without cron; sending does not.

  1. Run crontab -l as the web server user and confirm a bin/magento cron:run line exists, or that your platform runs the equivalent every minute.
  2. Check cron_schedule for recent ocmlabs_productmessaging_send entries with status success.
  3. Check the row’s Scheduled time. A rule with a send delay is supposed to sit as Pending until then.

A rule does not fire for an order

Work through these in order:

  1. Module switch. Stores > Configuration > OCM Labs > Product Messaging > General > Enabled must be Yes at the order’s store view scope.
  2. Rule status and action. The rule is Enabled, and Send Email (or Show Block on Success Page) is on.
  3. Scope. The order’s store view is in the rule’s Store Views (or none are selected), and the customer’s group is in Customer Groups (or none are selected). Guests are NOT LOGGED IN.
  4. Guests. For guest orders, Send Emails to Guests must be Yes. This affects emails only.
  5. SKU patterns. Compare the patterns with the SKU on the order line. Matching is case-insensitive and * is the only wildcard. For configurables and bundles, the order line SKU may be the child’s; turn on Match Child SKUs or add the child SKUs.
  6. Order line state. Fully cancelled or refunded lines never match.
  7. Trigger. An Invoice Created rule does nothing until an invoice is saved; a Shipment Created rule does nothing until a shipment containing a matched SKU is saved.
  8. Already sent. A rule emails each order at most once. If the Email Log already has a row for that rule and order, a later trigger is a no-op by design. Use Resend on the existing row.

Matching and sending errors are never shown on the storefront. They are written to the module’s own log, var/log/ocmlabs_productmessaging.log, which is the first place to look.

A shipment email did not go out for the second shipment

Expected. A rule sends once per order. The first shipment that contains a matched SKU queues the email; later shipments are no-ops for that rule. If two products in one order need separate shipment emails, give them separate rules.

Emails went to the wrong address

  • Everything went to one address: Test Mode is on. Check Sending > Test Mode at every scope, especially after copying a production database to staging.
  • Rows failed with a Test Mode error: Test Mode is on with an empty Test Mode Recipient. Rows fail rather than reach real customers.

Rows marked Failed

Open the row with View for the full error. Common causes: the selected email template was deleted (fails immediately, no retry), SMTP or transport errors (retried with backoff until Max Send Attempts), or an attachment over your mail server’s size limit. Fix the cause, then Resend.

A success-page block does not show

  • Enable Checkout Success-Page Blocks must be Yes.
  • The CMS block must be active. A disabled or deleted block renders nothing.
  • Blocks render only on the success page reached directly from checkout. Opening the success URL later, or navigating away and back, shows nothing by design.
  • A full-page cache or Varnish rule that caches checkout/onepage/success would serve stale content. Core Magento does not cache that page.

Attachment uploads fail

  • The file must be a real PDF, by both extension and content. Files exported from some tools with a .pdf extension but a different format are rejected.
  • The combined size of the rule’s attachments, including the new file, must be within Max Attachment Total Size.
  • Save the rule before uploading.

A template variable renders empty

  • Product attribute values are captured when the rule matches. A template change made after an email was queued still renders against that snapshot, so check the attribute was set on the product at that time.
  • cost is never captured.
  • matched_items_html must be written as {{var matched_items_html|raw}}; without |raw it renders as escaped markup.