Hello, I'm having the same difficulty.
I need to trigger an alert immediately after the action of sending the email "send". I could not understand where to insert the code to perform the action, follow the alert.js and test.php that I create inside plugin/ (folder).
PS: the add_hook option works the alert runs on all the screens, but as I said need only after sending the email
---
teste.php
class teste extends rcube_plugin
{
public $task = 'mail';
private $rc;
/**
* Plugin initialization
*/
function init()
{
$this->rc = rcmail::get_instance();
// Plugin actions
// $this->add_hook('startup', array($this, 'startup'));
$this->register_action('plugin.teste', array($this, 'startup'));
}
function startup($args)
{
$rcmail = rcmail::get_instance();
$this->include_script('alert.js');
// Only AJAX actions
$this->rc->output->send();
}
}
---
alert.js
$(document).ready(function(e) {
alert('Catanduvas verdes!!!!');
});
Thank You.
JC