Roundcube Community Forum

 

[Plugin] Read message on button click

Started by Martin Schrimpf, August 16, 2012, 05:51:44 AM

Previous topic - Next topic

Martin Schrimpf

Hello,

i am currently writing a Plugin for Roundcube which has the purpose to generate a PDF from a message.
But i can't figure out how to read the (currently opened) message on button click.

Google doesn't really help - i tried to solve the problem by reading the code of other plugins but didn't come to a solution yet.

I hope, somebody can help.

Best Regards,
Martin

SKaero

I think there is two ways to do this:
1. Start another imap request and get the message again.
2. Get the message using JS and send it back to the plugin.

Martin Schrimpf

Hi SKaero,

thank you for your reply!

The second way with JS you mentioned would be the preferred one here.
Unfortunately, i cannot find a way to read the message with JS (at least not in a comfortable way, we only found a way to read the message from the site-html) - could you give me some further help?

Best Regards,
Martin

SKaero

Well with the JS method you would have to get the formatted html version, but isn't that what you would want to make the pdf? How do you want the message formatted?

Martin Schrimpf

We solved it by getting the raw body with

rcmail
->storage->get_raw_body()

and converting the result to HTML with a MailParser.

Thank you for your help!

Volnhar

Hi,

I would be interested in having a look at this plugin as well. Sounds really handy when you want to get a pdf copy of your messages.