Hi,
How can i do this?
When i open up a mail in roundcube i wanna parse the senders email and inject a text to the reply body of that mail.
Im a php programmer, just have to know in wich files i have todo this.
Greetz
Gerd
I checked out the api of roundcube and found a hook i think i can use for this: message_compose
Where can i find a list of variables that i can use within the hooks?
http://trac.roundcube.net/wiki/Plugin_Hooks#message_compose
any helping hand, why doesn this replace the body?
<?php
/**
* veranderd_body
* @version 1.0
* @author Gerd K
* @url http://www.domain.com
*/
class verander_body extends rcube_plugin
{
public $task = 'mail';
function init()
{
$this->add_hook('message_compose', array($this, 'replace'));
}
function replace($args)
{
$args['body'] = "TEST TEST";
return $args;
}
}
?>
The body is in $args['body'] if you do the following:
$args['body'] = "TEST TEST";
it will replace the body.
If you want prepend do the following:
$args['body'] = "TEST TEST" . $args['body'];
it doesnt seem todo that
<?php
/**
* verander_body
*
* Sample plugin to replace emoticons in plain text message body with real icons
*
* @version 1.0
* @author Gerd Koetje
* @url http://www.pobb.nl
*/
class verander_body extends rcube_plugin
{
public $task = 'mail';
function init()
{
$this->add_hook('message_compose', array($this, 'replace'));
}
function replace($args)
{
$args['body'] = "TEST TEST";
}
}
?>
same when i return args
in my config i have
$rcmail_config['plugins'] = array('verander_body');
Reading back I see that you want to work with the reply, in which case you need to work use the message_compose_body hook.
that does the trick, thanks
how do i get the from variable from $this?
i tryed
$this->message->from;