There is a much easier method.. from PHP you can just say:
$rcmail = rcmail::get_instance();
$rcmail->output->show_message('my_plugin.my_label', 'confirmation');
Where my_label is a label from your localization strings. Look through existing plugins for examples.