<?php

function kompass_print_mail_compose(?string $to = null, ?string $subject = null)
{
	global $dbHandler;
    $current_user = wp_get_current_user();
	?>

    <form method="post" action="admin.php?page=kompass-mail" style="width: 80%; margin: auto">
	    <table style="width: 100%">
		    <input type="hidden" name="action" value="send-email" />
		    <tr>
			    <td><?= __('From: ', BDP_LV_PLUGIN_SLUG); ?></td>
			    <td><input type="text" name="mail-from" style="width: 100%" value="<?= $current_user->user_email; ?>"></td>
		    </tr>
		    <tr>
			    <td><?= __('To: ', BDP_LV_PLUGIN_SLUG); ?></td>
			    <td><input value="<?= $to ?? ''; ?>" type="text" name="mail-to" style="width: 100%"></td>
		    </tr>
		    <tr>
			    <td><?= __('Subject: ', BDP_LV_PLUGIN_SLUG); ?></td>
			    <td><input value="<?= $subject ?? ''; ?>" type="text" name="mail-subject" style="width: 100%"></td>
		    </tr>
	    </table>
	    <?php
        wp_editor( '<h3>[anrede]</h3><br />&nbsp;<br />', 'mycustomeditor', array(
            'textarea_name' => 'mail-text',
    		'media_buttons' => false,
            'tinymce' => ['content_style' => 'html{ background: none !important; }', ]

        ) );

        submit_button(__('Send email', BDP_LV_PLUGIN_SLUG));
        ?>
    </form>
<?php
}
