Troubleshooting emails that never send, rules that do not match, and missing blocks
Emails stay Pending in the Email Log
Almost always cron. Queuing works without cron; sending does not.
- Run
crontab -las the web server user and confirm abin/magento cron:runline exists, or that your platform runs the equivalent every minute. - Check
cron_schedulefor recentocmlabs_productmessaging_sendentries with statussuccess. - 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:
- Module switch. Stores > Configuration > OCM Labs > Product Messaging > General > Enabled must be Yes at the order’s store view scope.
- Rule status and action. The rule is Enabled, and Send Email (or Show Block on Success Page) is on.
- 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.
- Guests. For guest orders, Send Emails to Guests must be Yes. This affects emails only.
- 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. - Order line state. Fully cancelled or refunded lines never match.
- 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.
- 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/successwould 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
.pdfextension 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.
costis never captured.matched_items_htmlmust be written as{{var matched_items_html|raw}}; without|rawit renders as escaped markup.