|array{label:string, description:string, action_class:class-string}|null */ public static function getActions( $action = null ) { $actions = array( 'wait' => array( 'label' => __( 'Wait', 'afroit-messaging-workflows' ), 'description' => __( 'Wait for a specified amount of time.', 'afroit-messaging-workflows' ), 'action_class' => WaitAction::class, ), 'send_whatsapp' => array( 'label' => __( 'Send WhatsApp Message', 'afroit-messaging-workflows' ), 'description' => __( 'Send a WhatsApp message to the customer.', 'afroit-messaging-workflows' ), 'action_class' => SendWhatsAppAction::class, ), 'send_sms' => array( 'label' => __( 'Send SMS', 'afroit-messaging-workflows' ), 'description' => __( 'Send an SMS message to the customer via Twilio.', 'afroit-messaging-workflows' ), 'action_class' => SendSmsAction::class, ), 'send_email' => array( 'label' => __( 'Send Email', 'afroit-messaging-workflows' ), 'description' => __( 'Send an email to the customer using a WooCommerce email template.', 'afroit-messaging-workflows' ), 'action_class' => SendEmailAction::class, ), ); /** * Filter the workflow action registry. * * Add-ons may register extra actions (type => label, description, action_class). * * @param array $actions Action map. */ $actions = apply_filters( 'afromewo_workflow_actions', $actions ); if ( ! is_array( $actions ) ) { $actions = array(); } if ( $action ) { return $actions[ $action ] ?? null; } return $actions; } }