# yaymail/4.3.3/src/Abstracts/BaseShortcode.php

YayMail – WooCommerce Email Customizer, version 4.3.3. 30 lines.

- Page: https://pluginprobe.com/plugins/yaymail/4.3.3/code/src/Abstracts/BaseShortcode.php
- Raw: https://pluginprobe.com/plugins/yaymail/4.3.3/raw/src/Abstracts/BaseShortcode.php
- Modified: 2026-02-12T15:49:00+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/yaymail/4.3.3/code/src/Abstracts/BaseShortcode.php#L10-L20`.

```php
<?php
namespace YayMail\Abstracts;

/**
 * BaseShortcode Class
 */
abstract class BaseShortcode {

    public $available_email_ids = [ YAYMAIL_WITH_ORDER_EMAILS ];

    /**
     * Define list of shortcodes
     *
     * Shortcode structure: name, description, group, callback
     *
     * @return array list shortcodes
     */
    abstract public function get_shortcodes();

    protected function __construct() {
        foreach ( $this->available_email_ids as $email_id ) {
            add_action( 'yaymail_' . $email_id . '_register_shortcodes', [ $this, 'add_shortcodes_to_email' ] );
        }
    }

    public function add_shortcodes_to_email( $email ) {
        $email->register_shortcodes( $this->get_shortcodes() );
    }
}

```
