Search code examples
hyperlinkroundcube

Roundcube - set recipient in GET parameter


I'm trying to prepare a link to the Roundcube mailer hosted on my server, that would include recepient email address - is it possible?

I've been trying for some time, digging through the docs and even through the Roundcube's source code but no luck.

For clarification, I'd love to be able to have something like: http://webmail.myserver.tld/?_task=mail&_action=compose&[email protected] that would redirect an user (we can safely assume he is already logged in) to a "new message" form with a "To:" field filled with [email protected]

I've tried some different (obvious) names for "SOME_PARAM_NAME" (recipient, to, receiver, mailto, etc.) but it doesn't work. Any help will be appreciated.


Solution

  • I found out how to do it by looking here:

    http://vanappdeveloper.com/2012/07/30/roundcube-integration-with-an-iframe-in-a-3rd-party-cms-custom-attachments/

    In your plugin you would reference SOME_PARAM_NAME like so:

    $args['param']['SOME_PARAM_NAME']
    

    To set the 'to' address you would:

    $params['param']['to'] = $args['param']['SOME_PARAM_NAME'];
    

    You can do the same with body,cc,subject and bcc instead of 'to'

    Don't forget to return $params; at the end of the hook.