How to create a new letter by url?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to create a new letter by url?

Vladimir Gorpenko
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@...&to=d@...&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.

--
Best regards,
    Vladimir Gorpenko
_______________________________________________
Roundcube Development discussion mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: How to create a new letter by url?

A.L.E.C
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?subject=test

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.

--
Aleksander 'A.L.E.C' Machniak
Kolab Groupware Developer         [http://kolab.org]
Roundcube Webmail Developer   [http://roundcube.net]
----------------------------------------------------
PGP: 19359DC1 # Blog: https://kolabian.wordpress.com
_______________________________________________
Roundcube Development discussion mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: How to create a new letter by url?

Vladimir Gorpenko

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?subject=test
>
> 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
_______________________________________________
Roundcube Development discussion mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: How to create a new letter by url?

A.L.E.C
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/compose.inc#L350

--
Aleksander 'A.L.E.C' Machniak
Kolab Groupware Developer         [http://kolab.org]
Roundcube Webmail Developer   [http://roundcube.net]
----------------------------------------------------
PGP: 19359DC1 # Blog: https://kolabian.wordpress.com
_______________________________________________
Roundcube Development discussion mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: How to create a new letter by url?

Vladimir Gorpenko
1. 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?

2. Can I force HTML mode on?

---
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/compose.inc#L350
_______________________________________________
Roundcube Development discussion mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: How to create a new letter by url?

A.L.E.C
On 6/11/19 11:44 AM, Vladimir Gorpenko wrote:
> 1. 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?

> 2. 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.

--
Aleksander 'A.L.E.C' Machniak
Kolab Groupware Developer         [http://kolab.org]
Roundcube Webmail Developer   [http://roundcube.net]
----------------------------------------------------
PGP: 19359DC1 # Blog: https://kolabian.wordpress.com
_______________________________________________
Roundcube Development discussion mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: How to create a new letter by url?

Vladimir Gorpenko
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:
>> 1. 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?
>
>> 2. 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.
_______________________________________________
Roundcube Development discussion mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/dev