|
|
|
|
|
|
|
Find automation progress steps with activation label
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
// Remove the automation progress step title
// "Please contact support@oncord.com to activate your account" (title ID 3)
$strTitleId = 3;
// Confirm it exists and matches exactly
$arrTitle = \Components\Marketing\Automation\Progress\Steps\Titles::get($strTitleId);
if (!$arrTitle)
{
echo "Title ID {$strTitleId} not found — nothing to do.\n";
return;
}
echo "Found title #{$strTitleId}: \"{$arrTitle['automation_progress_step_title_name']}\"\n";
// Show which progress steps reference it, then clear the reference
$arrSteps = \Components\Marketing\Automation\Progress\Steps::getAll([
'filter' => [['automation_progress_step_result_title_id', '=', $strTitleId]],
'limit' => 500
]);
echo count($arrSteps) . " progress step(s) reference this title; clearing their result_title_id...\n";
foreach ($arrSteps as $arrStep)
{
$arrStep['automation_progress_step_result_title_id'] = null;
\Components\Marketing\Automation\Progress\Steps::save($arrStep);
echo " - Cleared reference on progress step (automation_progress_id={$arrStep['automation_progress_id']}, automation_step_id={$arrStep['automation_step_id']})\n";
}
// Delete the title record itself
\Components\Marketing\Automation\Progress\Steps\Titles::delete($strTitleId);
echo "Deleted title #{$strTitleId}.\n";
echo "Done. The label will no longer appear in automation activity entries.\n";
|
|
This will do two things:
1. **Unlink the message from any steps that use it.** It looks through the system for up to 500 automation progress steps that currently point to this particular message ("Please contact support@oncord.com to activate your account"). For each one it finds, it removes that connection, so those steps will no longer show this message. The steps themselves are kept — only the link to the message is removed.
2. **Delete the message itself.** Once nothing points to it anymore, the message is permanently removed from the system. After this, that "please contact support to activate your account" text will no longer appear anywhere in automation activity entries.
If the message doesn't exist in the first place, nothing is changed at all.
|
|
|