Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: deltatech on May 04, 2011, 01:09:04 AM

Title: Question about creating a plugin.
Post by: deltatech on May 04, 2011, 01:09:04 AM
I have created a new plugin that modifies the outgoing emails.  It is working great except one thing.  I only want to modify the html portion of the email and NOT the text portion.

Can anyone tell me what I have to do to only modify the html section?

I have this hook in my init.. is there a better hook that will only grab the html?

$this->add_hook('message_outgoing_body', array($this,'replace'));

And I have this in my replace function hoping to ignore the text portion but, doesn't seem to make any difference..


if( $args['type']=='plain' )
   return null;
Title: Question about creating a plugin.
Post by: rosali on May 04, 2011, 01:41:18 AM
Did you check the real content type?

Is it 'alternative'?

You could check by:

write_log('mydebug',$args);
Title: Question about creating a plugin.
Post by: deltatech on May 04, 2011, 01:45:49 AM
Quote from: rosali;34618Did you check the real content type?

Is it 'alternative'?

You could check by:

write_log('mydebug',$args);

I seem to have solved it by changing it to this

if( $args['type']!='html'
    return null;


It is a good working plugin.  If anyone is interested I suppose I can post it somewhere.   basically if someone puts a URL or an email address in their html message and doesn't wrap it with a tags,  the plugin wraps it for them.

I am new to roundcube and have never posted a plugin anywhere before.
Title: Question about creating a plugin.
Post by: rosali on May 04, 2011, 02:05:08 AM
I suggest to open a repository on googlecode or github and to host it there.

Post the url of the repo here or mail'me. I'll link it then on roundcube wiki and there:

http://www.roundcubeforum.net/7-third-party-contributions/46-api-based-plugins/4830-plugin-repositories.html