php js css php js css

Scripts

Save Script Run
Attached Artifacts
Title
PHP Code
<?php $disabled = \Components\Marketing\Automation\Progress::getDisabledIds(); \Components\Marketing\Automation\Progress::setDisabledIds(array_column(\Components\Marketing\Automation::getAll(), 'automation_id')); try { // Keep the Friday assignment roster simple; the Wednesday class illustrates a converted trial. \Components\AF\Enrollments::save(['enrollment_id' => 367, 'course_id' => 377, 'enrollment_comment' => 'Presentation Demo - converted trial, retained for reporting']); $rows = \Components\AF\Enrollments::getAll(['filter' => [['course_id','=',377], 'AND', ['contact_id','=',1394], 'AND', ['enrollment_type','=','standard']], 'limit' => 1]); if (!$rows) \Components\AF\Enrollments::save(['course_id' => 377, 'contact_id' => 1394, 'enrollment_type' => 'standard', 'enrollment_created_datetime' => '2026-10-07 00:00:00', 'enrollment_comment' => 'Presentation Demo - enrolled after trial']); $rows = \Components\AF\Enrollments::getAll(['filter' => ['course_id','IN',[376,377]]]); $split = \Components\AF\Enrollments::summariseTrials($rows); $out = []; foreach ($split as $type => $records) $out[$type] = count($records); echo json_encode($out, JSON_PRETTY_PRINT); } finally { \Components\Marketing\Automation\Progress::setDisabledIds($disabled); }

Run Log

▼ Today 4:33am ✓ Completed 0.1s
{
    "enrollments": 4,
    "trials": 2,
    "makeups": 1,
    "converted": 1
}