Hi!
I would like to be able to immediately enter the RoundCube in the mode of creating a new letter by url from another application.
Some fields, such as "from", "to" and "body" of the created letter must be initially filled with the data transmitted in the request.
Since the volume of this data can be significant, it is advisable to use the POST method. However, if only the GET method is available, I will find another way to pass the information.
In other words, I want to be able to create a link such as
https://rcmail.a.b/newletter?from=a@b.c&to=d@e.f&body=Hello!
in another application; when clicking on it, the user would open a window for creating a new letter in RC with partially filled content.
For this illustration, I use a more visual GET method, but of course POST is desirable.
Is it possible to do this in principle without reworking the RC thorough and what means are there for it?
I apologize for my English, I use Google translator.
On 6/11/19 10:06 AM, Vladimir Gorpenko wrote:
Hi!
I would like to be able to immediately enter the RoundCube in the mode of creating a new letter by url from another application.
POST is not supported, but you can use GET.
https://rcmail.a.b?_task=mail&_action=compose&to=mailto:some@email?s...
Supported fields: 'to', 'cc', 'bcc', 'reply-to', 'in-reply-to', 'references', 'subject', 'body'.
POST data would be lost in a logon process anyway, but I guess you can do something using plugin API.
Thank you, this is practically what I needed.
Is there a hook that would allow me to intercept the processing of this call and replace, for example, the value of body with the text calculated from this value?
If there is no such hook, please give me an approximate location in the source code where I could add this hook.
I have already added my own hooks for a long time, since I did S/MIME encryption.
A.L.E.C писал 2019-06-11 11:35:
On 6/11/19 10:06 AM, Vladimir Gorpenko wrote:
Hi!
I would like to be able to immediately enter the RoundCube in the mode of creating a new letter by url from another application.
POST is not supported, but you can use GET.
https://rcmail.a.b?_task=mail&_action=compose&to=mailto:some@email?s...
Supported fields: 'to', 'cc', 'bcc', 'reply-to', 'in-reply-to', 'references', 'subject', 'body'.
POST data would be lost in a logon process anyway, but I guess you can do something using plugin API.
Best regards, Vladimir Gorpenko
On 6/11/19 11:23 AM, Vladimir Gorpenko wrote:
Is there a hook that would allow me to intercept the processing of this call and replace, for example, the value of body with the text calculated from this value?
If there is no such hook, please give me an approximate location in the source code where I could add this hook.
You can use message_compose hook. https://github.com/roundcube/roundcubemail/blob/master/program/steps/mail/co...
you named (from, to, ...), will the process of creating a letter begin? Will this parameter be available to the plugin by message_compose?
Best regards, Vladimir Gorpenko
A.L.E.C писал 2019-06-11 12:32:
On 6/11/19 11:23 AM, Vladimir Gorpenko wrote:
Is there a hook that would allow me to intercept the processing of this call and replace, for example, the value of body with the text calculated from this value?
If there is no such hook, please give me an approximate location in the source code where I could add this hook.
You can use message_compose hook. https://github.com/roundcube/roundcubemail/blob/master/program/steps/mail/co...
On 6/11/19 11:44 AM, Vladimir Gorpenko wrote:
- If there is a parameter with a name that is not in the list of those you named (from,
to, ...), will the process of creating a letter begin? Will this parameter be available to the plugin by message_compose?
How about you just try?
- Can I force HTML mode on?
It is assumed HTML if body contains '<' character (this is done before the hook), but you can set also the 'html' parameter in the hook.
Yes, I can verify that the letter creation process has started. But to check that the plugin receives this parameter, I need to write a plugin.
Thanks again for the help, it will help me solve my problem anyway.
Best regards, Vladimir Gorpenko
A.L.E.C писал 2019-06-11 12:51:
On 6/11/19 11:44 AM, Vladimir Gorpenko wrote:
- If there is a parameter with a name that is not in the list of
those you named (from, to, ...), will the process of creating a letter begin? Will this parameter be available to the plugin by message_compose?
How about you just try?
- Can I force HTML mode on?
It is assumed HTML if body contains '<' character (this is done before the hook), but you can set also the 'html' parameter in the hook.
Hi!
It seems it is not working. I do not use hoke yet, I just pass this URL:
https://web2.stels.ru/mail?_task=mail&_action=compose&to=mailto:vasj.... ... %D0%BD&body=<br>
The letter creation page opens, but in text format. And the body of the letter looks like this:
Am I doing something wrong?
Best regards, Vladimir Gorpenko
A.L.E.C писал 2019-06-11 12:51:
On 6/11/19 11:44 AM, Vladimir Gorpenko wrote:
- Can I force HTML mode on?
It is assumed HTML if body contains '<' character (this is done before the hook), but you can set also the 'html' parameter in the hook.
On 7/16/19 4:24 PM, Vladimir Gorpenko wrote:
Hi!
It seems it is not working. I do not use hoke yet, I just pass this URL:
https://web2.stels.ru/mail?_task=mail&_action=compose&to=mailto:vasj.... ... %D0%BD&body=<br>
You're using some old Roundcube version. Works for me with 1.3 and git-master.