emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Xebar Saram <zeltakc@gmail.com>
Cc: "emacs-orgmode@gnu org" <emacs-orgmode@gnu.org>
Subject: Re: create a "send plain text/pdf email with current header" function?
Date: Wed, 05 Aug 2015 14:38:48 -0400	[thread overview]
Message-ID: <m2egjh60nb.fsf@andrew.cmu.edu> (raw)
In-Reply-To: <CAOQHXPp=SKrVCS0tu3YorOinsZkt1L87sNVvZe_d7V9VhJWRZg@mail.gmail.com>

* Automatic send email to myself

#+BEGIN_SRC emacs-lisp
(defun email-heading-to-me ()
  "Send the current org-mode heading as the body of an email, with headline as the subject."
  (interactive)
  (save-excursion
    (org-mark-subtree)
    (let ((content (buffer-substring (point) (mark)))
          (SUBJECT (nth 4 (org-heading-components))))

      (compose-mail "your@email.here" SUBJECT)
      (message-goto-body)
      (insert content)
      (message-send)
      (message-kill-buffer))))
#+END_SRC

#+RESULTS:
: email-heading-to-me


Xebar Saram writes:

> thx both John and Matt
>
> I went on and used johns function he recommended (since i needed a simple
> text only export) and it works flawlessly :)
>
> John: just a quick follow up though
>
> with that function you kindly shred "email-heading " it opens up a buffer
> and you insert the email address. is it possible to have a function that
> sends to a prefixed email address (ie myself :)). also can the function
> then just do it in the background without even opening the buffer? since i
> want to send it to a prefixed email i dont really need to see it and press
> C-c C-c.
>
> This isnt really important so if its complicated please feel free to ignore
> ;-)
>
> best
>
> Z
>
>
> On Sat, Aug 1, 2015 at 6:24 PM, John Kitchin <johnrkitchin@gmail.com> wrote:
>
>> You probably could use the function here
>> https://github.com/jkitchin/jmax/blob/master/email.el#L51 for the email
>> part after you find the heading you want to send. I think there is some
>> code there to send a pdf too.
>>
>>
>> On August 1, 2015, at 10:49 AM, Xebar Saram <zeltakc@gmail.com> wrote:
>>
>>
>> Hi all
>> i find that i keep copy pasting food recipes  (which i collect with org
>> obviously) to my email client and then sending it over to the phone to use
>> in the kitchen (which reminds Me really should get a emacs touch screen for
>> the kitchen..though my wife would get a stroke if she sees that
>> ;-))..anyway, anyone knows how one (with almost none to zero elisp skills)
>> create such a function?
>>
>> all i need is locate the recipe (header) and then send the header and sub
>> headers as text or pdf to my email
>>
>> best!
>>
>> Z
>>
>>

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

  reply	other threads:[~2015-08-05 18:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-01 15:24 create a "send plain text/pdf email with current header" function? John Kitchin
2015-08-01 17:43 ` Matt Price
2015-08-05 11:34 ` Xebar Saram
2015-08-05 18:38   ` John Kitchin [this message]
2015-08-06  4:42     ` Xebar Saram
2015-08-06  6:24       ` Eric Abrahamsen
  -- strict thread matches above, loose matches on Subject: below --
2015-08-01 14:49 Xebar Saram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2egjh60nb.fsf@andrew.cmu.edu \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=zeltakc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).