public static function queue_task($userid) {
        // Let's set up the adhoc task.
        $task = new \core_message\task\migrate_message_data();
        $task->set_custom_data(
            [
                'userid' => $userid
            ]
        );

        // Queue it.
        \core\task\manager::queue_adhoc_task($task, true);
    }