Skip to content

Latest commit

 

History

History

auto-delete-customer-metafields-older-than-x-days

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Auto-delete customer metafields older than X days

Tags: Customers, Delete, Metafields

Use this task to auto-delete customer metafields that are older than the configured minimum age in days. Useful for removing transient metafields a certain number of days after they have been created.

Default options

{
  "customer_metafields_to_monitor__array_required": null,
  "minimum_age_in_days_before_deletion__number_required": null,
  "test_mode__boolean": true
}

Learn about task options in Mechanic

Subscriptions

mechanic/scheduler/daily
mechanic/user/trigger

Learn about event subscriptions in Mechanic

Documentation

Use this task to auto-delete customer metafields that are older than the configured minimum age in days. Useful for removing transient metafields a certain number of days after they have been created.

Enter one or more metafields using namespace.key format (e.g. "custom.recent_purchase" ), and on the daily task run it will find and delete any matching customer metafield which was created at prior to the cutoff date.

It is highly recommended to first run this task using the Test mode option, so it can log out which metafields have qualified for deletion without actually deleting them. Pair this with running the task manually to avoid waiting for the next scheduled task run to see the test mode logging.

Note: The "cutoff date" uses the beginning of the task run day (i.e. midnight local shop time) as the start time to count backwards the configured minimum age in days.

Installing this task

Find this task in the library at tasks.mechanic.dev, and use the "Try this task" button. Or, import this task's JSON export – see Importing and exporting tasks to learn how imports work.

Contributions

Found a bug? Got an improvement to add? Start here: ../../CONTRIBUTING.md.

Task requests

Submit your task requests for consideration by the Mechanic community, and they may be chosen for development and inclusion in the task library!