backend_followup_edit

Allows adding of custom content to followup message editing page.

Shop-Script

Input (passed by reference)

$followup array Followup message properties.
… your plugin code …

Output

{$backend_followup_edit.%plugin_id%}

Custom HTML code. By default, it is placed within a hidden block; therefore it might be useful to also add some JavaScript code to display that hidden block.

Shop-Script

Plugin code example

PHP

public function backendFollowupEdit($followup)
{
    $subject = $followup['subject'];
    $subject_is_short = mb_strlen($subject) < self::MIN_FOLLOWUP_SUBJECT_LENGTH;

    if ($subject_is_short) {
        $message = sprintf_wp('Too short subject: “%s”.', $subject);

        return <<<HTML
            <div class="block errormsg">
                {$message}
            </div>
            <script>
                \$('.followup-plugin-wrapper.{$this->id}-plugin').show();
            </script>
HTML;
    }
}