• 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 Fix the “Failed to set data for key _action” Error in ShopMagic – WooCommerce Case Study

Published: July 2, 2025 / Updated: December 4, 2025 / Blog

How to Fix the “Failed to set data for key _action” Error in ShopMagic – WooCommerce Case Study

Sebastian Rybacki

Customer communication automation is one of the key elements of a successful online store. With the ShopMagic PRO plugin, you can easily send automated emails to your customers, remind them about abandoned carts, or thank them for their purchases. However, even the best tools can sometimes face technical obstacles – especially when it comes to server or database configuration.

In this article, we’ll show you how one ShopMagic user encountered an error when trying to save an automation, what caused the issue, and how it was successfully resolved. It’s not only a practical example but also a valuable lesson for anyone looking to unlock the full potential of ShopMagic.

The issue: error when saving automation in ShopMagic PRO

A user of our ShopMagic PRO plugin contacted us because they were encountering the following errors when trying to save an automation with a custom HTML email template:

  • Fatal error while saving automation, Failed to set data for key _action
  • HTTP Error, Failed to set data for key _action

Interestingly, the error only occurred when using the “Send Email” or “Raw HTML” options. When switching to “Plain Text,” the automation saved without any issues. The user had already enabled debugging and increased PHP limits, but the debug.log file showed no trace of the error.

Diagnosis: an invisible character encoding problem

After running some tests, the user identified the root cause – the email message they were trying to save contained emojis. Their database was set up with UTF8MB3 encoding, which does not support four-byte characters like emojis. As a result, the plugin could not store the data in the database, and the operation failed.

What solved the issue?

The fix was simple yet effective – the user changed the column encoding in the database to UTF8MB4, and the automation saved without any errors.

This allowed the user to continue using ShopMagic PRO with fully customized messages, emojis, and advanced HTML formatting.

How to fix a similar issue on your own

If you ever run into a similar error when saving automations in ShopMagic PRO, here’s what you should check:

  1. Check the characters you’re using
    Does your message contain emojis or unusual characters? Try saving a version without them – if it works, the issue is likely caused by your database encoding.
  2. Inspect your database encoding
    • Log into your database management tool (e.g., phpMyAdmin).
    • Find the wp_postmeta table where ShopMagic stores data.
    • Make sure the relevant columns use the utf8mb4_unicode_ci (or at least utf8mb4_general_ci) collation.

    If your database still uses utf8 or utf8mb3, consider upgrading to utf8mb4 to ensure full compatibility with four-byte characters.

  3. Enable debug mode in ShopMagic
    In the WordPress dashboard, go to ShopMagic → Settings and enable debug mode. This will help log any issues during automation execution.

    You can find more about debugging in ShopMagic’s documentation.

Why use ShopMagic?

ShopMagic is much more than just an email automation plugin. It offers a wide range of features that help WooCommerce store owners grow their sales and build lasting customer relationships:

  • Intuitive automation builder – create workflows without writing any code.
  • Multiple message formats – from simple plain text to advanced HTML templates with dynamic variables.
  • Conditions and delays – send messages at the right time to the right people.

All of this makes ShopMagic a flexible tool for process automation in WooCommerce – suitable for both beginners and advanced users.

Summary & Takeaways

Technical issues like “Failed to set data for key _action” can often have non-obvious causes – such as incompatible database encoding. In this real case, a ShopMagic user solved the problem by switching the column encoding to utf8mb4, which enabled saving messages with emojis.

Here’s what we can learn from this:

  • It’s worth investigating errors step by step – don’t give up too quickly.
  • ShopMagic is a powerful and flexible automation tool worth exploring.
  • ShopMagic’s support and documentation can make troubleshooting much easier.

👉 Want to create high-converting email campaigns in WooCommerce? Try ShopMagic PRO today. And if you need help – our support team is here for you!

About Sebastian Rybacki

  • 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}