src/Compose.php
/**
     * Sends an email when WordPress action is being fired.
     *
     * @param string $action
     * @param Mailable $mailable
     * @param int $priority
     *
     * @return static
     */
Sends an email when WordPress action is being fired.

@return static
Sends an email when WordPress action is being fired . @return static
public function sendOnAction(string $action, Mailable $mailable, int $priority = 10)
    {
        if (\current_action() === $action) {
            $this->send($mailable);
        }
        if (!\did_action($action)) {
            \add_action($action, function () use ($mailable) {
                $this->send($mailable);
            }, $priority);
        }
        return $this;
    }
public function sendOnAction ( string $ action , Mailable $ mailable , int $ priority = 10 ) { if ( \ current_action ( ) === $ action ) { $ this -> send ( $ mailable ) ; } if ( ! \ did_action ( $ action ) ) { \ add_action ( $ action , function ( ) use ( $ mailable ) { $ this -> send ( $ mailable ) ; } , $ priority ) ; } return $ this ; }
Sends an email when WordPress action is being fired.
Sends an email when WordPress action is being fired .