• Skip to primary navigation
  • Skip to main content
ShopMagic logo cropped for use as a site icon
WP Desk

WP Desk

WooCommerce Plugins

Flexible Invoices

Flexible Invoices

Automate invoicing

Flexible Coupons

Flexible Coupons

Gift cards and tickets

ShopMagic

  • Pricing
  • Add-ons
  • Docs
  • Support
  • Blog
  • Ideas
  • My account
  • English
How to solve the “Fatal Error While Saving Automation” in ShopMagic – a case study

Published: April 24, 2025 / Updated: October 23, 2026 / Blog

How to solve the “Fatal Error While Saving Automation” in ShopMagic – a case study

Krzysztof Skorupa

An automation saves without complaint in plain text, then fails the moment you switch it to custom HTML: “Fatal error while saving automation, Failed to set data for key _action”. Raising PHP packet sizes does not help and debug logging produces nothing useful, which is why this one is usually chased in the wrong place.

What causes the fatal error while saving automation

The cause sits in the database, not in the plugin. The error appears only when the automation contains custom HTML, because that content can carry four-byte characters such as emojis, and a database running UTF8mb3 encoding cannot store them. Changing the encoding to UTF8MB4 resolves it. The sections below show how the case was diagnosed, so you can confirm it matches your own symptoms before touching anything.

Error message 'Fatal error while saving automation' in ShopMagic for WooCommerce\

Situation/Challenge Description – Fatal Error While Saving Automation

Our client reported an issue when trying to save an email automation in the ShopMagic plugin. The error message “Fatal error while saving automation, Failed to set data for key _action” appeared only when he tried to set up an email with custom HTML (using the “Send Email” or “Raw HTML” options). Emails in “Plain Text” format worked fine.

Client had already changed PHP settings to allow larger packet sizes, but the problem still occurred. He also enabled debugging, but no useful information appeared in the logs.

Case Analysis and Solution for Fatal Error While Saving Automation

Step 1: Understand the Problem
We thought the issue might be related to incorrect database encoding, especially when emojis or special characters were used in the email. These types of errors often occur due to incompatible encoding that does not support certain characters.

Step 2: Test the Solution
We asked the client to perform several tests:

  • Check if the problem still occurs with only WooCommerce and ShopMagic active, while disabling all other plugins.
  • Review the database settings to ensure the encoding supports emojis and other characters.

Step 3: Final Solution
After reviewing the case, we found that the problem was caused by incorrect database encoding. Client used a database with UTF8mb3 encoding, which did not support characters like emojis. Once we changed the database encoding to UTF8MB4, the problem was solved.

Practical Tip:
Before using ShopMagic to send emails with custom HTML, make sure your database uses UTF8MB4 encoding. This encoding supports all characters, including emojis, and prevents issues when saving automations.

Summary and Conclusions

The error “Fatal error while saving automation, Failed to set data for key _action” appears when a ShopMagic automation is saved with custom HTML content, through either the Send Email or the Raw HTML option. Automations in plain text save normally, and that contrast is what points at the cause.

It is not a PHP limit. Increasing packet sizes changes nothing, and debug logging produces no entry that explains the failure, so the usual troubleshooting path leads nowhere.

The cause is database encoding. UTF8mb3 cannot store four-byte characters such as emojis, and custom HTML content often contains them. Converting the database to UTF8MB4 removes the error.

Checking the encoding before building HTML automations is the whole prevention. On a database already running UTF8MB4, this failure cannot occur.

Check all the features of the plugin in our demo.

ShopMagic PRO £69

Free Follow-Up Emails & Marketing Automation for WooCommerce

Add to cart or View Details
WP Desk
10,000+ Active Installations

About Krzysztof Skorupa

  • Terms & Conditions
  • Privacy Policy
  • Support Policy
  • Refund Policy

© 2026 A WP Desk WP Desk Automation

Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}