emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* mailto link with a subject and a content
@ 2015-01-12 17:19 PICCA Frederic-Emmanuel
  2015-01-16  0:25 ` John Kitchin
  2015-01-16  1:16 ` Eric Abrahamsen
  0 siblings, 2 replies; 5+ messages in thread
From: PICCA Frederic-Emmanuel @ 2015-01-12 17:19 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Hello, I would like to create a link (exported as html) which allow to prefill the content of the emai when we click on it.

Something like

       To: submit@bugs.debian.org
       Subject: My problem with hkl...

       Package: hkl
       Version: @VERSION@

       I found this problem in hkl...

Is it possible to do this kind of things with org-mode ?

thanks

Frederic

PS: I found nothing about the content in the documentation

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mailto link with a subject and a content
  2015-01-12 17:19 mailto link with a subject and a content PICCA Frederic-Emmanuel
@ 2015-01-16  0:25 ` John Kitchin
  2015-01-16  1:16 ` Eric Abrahamsen
  1 sibling, 0 replies; 5+ messages in thread
From: John Kitchin @ 2015-01-16  0:25 UTC (permalink / raw)
  To: PICCA Frederic-Emmanuel; +Cc: emacs-orgmode@gnu.org

I don't think a link is what you want here. You only get one piece of
information out of box when you click on a link,
e.g. mailto:jkitchin@andrew.cmu.edu (in my org-mode) will open a message
addressed to me. It is conceivable you could use syntax like
[[mailto:some@email.com][Some subject]], but you would need to get the
element at point to get to the Some subject part.

It is easier to use a headline as the subject, and properties of the
headline to store the email address. See the function here:

https://github.com/jkitchin/jmax/blob/master/email.el#L51

Which sends an org-headline as an email with the headline as the
subject, and contents as the body. After you send the email, it stores
who you sent it to, and when as properties of that headline.

There are some other simpler email functions in there too.

PICCA Frederic-Emmanuel writes:

> Hello, I would like to create a link (exported as html) which allow to prefill the content of the emai when we click on it.
>
> Something like
>
>        To: submit@bugs.debian.org
>        Subject: My problem with hkl...
>
>        Package: hkl
>        Version: @VERSION@
>
>        I found this problem in hkl...
>
> Is it possible to do this kind of things with org-mode ?
>
> thanks
>
> Frederic
>
> PS: I found nothing about the content in the documentation

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mailto link with a subject and a content
  2015-01-12 17:19 mailto link with a subject and a content PICCA Frederic-Emmanuel
  2015-01-16  0:25 ` John Kitchin
@ 2015-01-16  1:16 ` Eric Abrahamsen
  2015-01-16  8:23   ` Christian Moe
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Abrahamsen @ 2015-01-16  1:16 UTC (permalink / raw)
  To: emacs-orgmode

PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
writes:

> Hello, I would like to create a link (exported as html) which allow to prefill the content of the emai when we click on it.
>
> Something like
>
>        To: submit@bugs.debian.org
>        Subject: My problem with hkl...
>
>        Package: hkl
>        Version: @VERSION@
>
>        I found this problem in hkl...
>
> Is it possible to do this kind of things with org-mode ?

I think mailto: link syntax comes with GET-style parameters that allow
prefilling of some headers, ie
"mailto:someone@address.com?subject=BugReport", but that's pretty
limited. John's right that if what you want is the above, you should
probably just write some function to do it.

Incidentally, when I just tried to test the above, org would only send
the link to Conkeror, instead of opening in Gnus. Dunno what's going on
there.

Eric

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mailto link with a subject and a content
  2015-01-16  1:16 ` Eric Abrahamsen
@ 2015-01-16  8:23   ` Christian Moe
  2015-01-16  8:34     ` PICCA Frederic-Emmanuel
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Moe @ 2015-01-16  8:23 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: frederic-emmanuel.picca, emacs-orgmode


Hi,

This works fine for me with mu4e as the mail client. It's not guaranteed
to work with every client, but it can be a solution for personal
use. It's not necessarily the best solution.

The general syntax is mailto:address?subject=text&body=text

Some applications even allow adding attachments the same way
(...&attachment=...), but mu4e doesn't seem to.

If you keep everything on one line and in a bracketed link, you don't
even have to worry about replacing spaces with "%20":

[[mailto:who@where.org?subject=Some words&body=Some more words]]

But it's probably recommendable to URL-encode spaces and punctuation,
and I find it's necessary if you have newlines. You can use the
url-encode-url function for this.

So the OP's example would be:

[[mailto:submit@bugs.debian.org?subject=%20My%20problem%20with%20hkl...&body=Package:%20hkl%0AVersion:%20@VERSION@%0A%0AI%20found%20this%20problem%20in%20hkl...]]

(The brackets are needed if you actually want to keep the trailing dots.)

Yours,
Christian

Eric Abrahamsen writes:

> PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr>
> writes:
>
>> Hello, I would like to create a link (exported as html) which allow to prefill the content of the emai when we click on it.
>>
>> Something like
>>
>>        To: submit@bugs.debian.org
>>        Subject: My problem with hkl...
>>
>>        Package: hkl
>>        Version: @VERSION@
>>
>>        I found this problem in hkl...
>>
>> Is it possible to do this kind of things with org-mode ?
>
> I think mailto: link syntax comes with GET-style parameters that allow
> prefilling of some headers, ie
> "mailto:someone@address.com?subject=BugReport", but that's pretty
> limited. John's right that if what you want is the above, you should
> probably just write some function to do it.
>
> Incidentally, when I just tried to test the above, org would only send
> the link to Conkeror, instead of opening in Gnus. Dunno what's going on
> there.
>
> Eric

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mailto link with a subject and a content
  2015-01-16  8:23   ` Christian Moe
@ 2015-01-16  8:34     ` PICCA Frederic-Emmanuel
  0 siblings, 0 replies; 5+ messages in thread
From: PICCA Frederic-Emmanuel @ 2015-01-16  8:34 UTC (permalink / raw)
  To: Christian Moe, Eric Abrahamsen; +Cc: emacs-orgmode@gnu.org

> [[mailto:submit@bugs.debian.org?subject=%20My%20problem%20with%20hkl...&body=Package:%20hkl%0AVersion:%20@VERSION@%0A%0AI%20found%20this%20problem%20in%20hkl...]]

Thanks a lot this is exactly what I wanted :).

Thanks also to the other's for the time they spent answering my question.

Cheers

Frederic

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-16  8:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-12 17:19 mailto link with a subject and a content PICCA Frederic-Emmanuel
2015-01-16  0:25 ` John Kitchin
2015-01-16  1:16 ` Eric Abrahamsen
2015-01-16  8:23   ` Christian Moe
2015-01-16  8:34     ` PICCA Frederic-Emmanuel

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).