Author Topic: Question about creating a plugin.  (Read 5023 times)

Offline deltatech

  • Jr. Member
  • **
  • Posts: 41
Question about creating a plugin.
« 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?

Code: [Select]
$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..


Code: [Select]
if( $args['type']=='plain' )
   return null;

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Question about creating a plugin.
« Reply #1 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);
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline deltatech

  • Jr. Member
  • **
  • Posts: 41
Question about creating a plugin.
« Reply #2 on: May 04, 2011, 01:45:49 AM »
Quote from: rosali;34618
Did 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

Code: [Select]
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.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Question about creating a plugin.
« Reply #3 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
Regards,
Rosali
__________________
MyRoundcube Project (commercial)