emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* create a "send plain text/pdf email with current header" function?
@ 2015-08-01 14:49 Xebar Saram
  0 siblings, 0 replies; 7+ messages in thread
From: Xebar Saram @ 2015-08-01 14:49 UTC (permalink / raw)
  To: org mode

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 633 bytes --]

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

* Re: create a "send plain text/pdf email with current header" function?
@ 2015-08-01 15:24 John Kitchin
  2015-08-01 17:43 ` Matt Price
  2015-08-05 11:34 ` Xebar Saram
  0 siblings, 2 replies; 7+ messages in thread
From: John Kitchin @ 2015-08-01 15:24 UTC (permalink / raw)
  To: Xebar Saram, emacs-orgmode@gnu org

[-- Attachment #1: Type: text/plain, Size: 808 bytes --]

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



[-- Attachment #2: Type: text/html, Size: 1066 bytes --]

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

* Re: create a "send plain text/pdf email with current header" function?
  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
  1 sibling, 0 replies; 7+ messages in thread
From: Matt Price @ 2015-08-01 17:43 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]

After getting some help from the list, I wrote a post about something
pretty close to what you want here:

http://matt.hackinghistory.ca/2015/07/15/mailing-subtrees-with-attachments/

There's a little more code there than you actually need, but some of it may
be helpful.  Happy to answer questions, too.

mp

On Sat, Aug 1, 2015 at 11:24 AM, 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
>
>

[-- Attachment #2: Type: text/html, Size: 2046 bytes --]

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

* Re: create a "send plain text/pdf email with current header" function?
  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
  1 sibling, 1 reply; 7+ messages in thread
From: Xebar Saram @ 2015-08-05 11:34 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode@gnu org

[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2413 bytes --]

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

* Re: create a "send plain text/pdf email with current header" function?
  2015-08-05 11:34 ` Xebar Saram
@ 2015-08-05 18:38   ` John Kitchin
  2015-08-06  4:42     ` Xebar Saram
  0 siblings, 1 reply; 7+ messages in thread
From: John Kitchin @ 2015-08-05 18:38 UTC (permalink / raw)
  To: Xebar Saram; +Cc: emacs-orgmode@gnu org

* 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

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

* Re: create a "send plain text/pdf email with current header" function?
  2015-08-05 18:38   ` John Kitchin
@ 2015-08-06  4:42     ` Xebar Saram
  2015-08-06  6:24       ` Eric Abrahamsen
  0 siblings, 1 reply; 7+ messages in thread
From: Xebar Saram @ 2015-08-06  4:42 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode@gnu org

[-- Attachment #1: Type: text/plain, Size: 2705 bytes --]

Perfect! (as always i might add John ;))

thx so muxh

Z

On Wed, Aug 5, 2015 at 9:38 PM, John Kitchin <jkitchin@andrew.cmu.edu>
wrote:

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

[-- Attachment #2: Type: text/html, Size: 3933 bytes --]

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

* Re: create a "send plain text/pdf email with current header" function?
  2015-08-06  4:42     ` Xebar Saram
@ 2015-08-06  6:24       ` Eric Abrahamsen
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Abrahamsen @ 2015-08-06  6:24 UTC (permalink / raw)
  To: emacs-orgmode

Xebar Saram <zeltakc@gmail.com> writes:

> Perfect! (as always i might add John ;))
>
> thx so muxh

Just to add to the mess, here's something I've used before -- kind of a
poor man's mail merge, to send spam (not really spam!).



(defvar my-spam-sent-names nil
 "Make sure that, even if we have to run this multiple times, people
 don't get spammed more than once.")

(defun my-spam-headline ()
  (org-narrow-to-subtree)
  (cl-flet ((mp (p) (org-entry-get nil p t)))
    (let* ((org-inhibit-logging t)
	   (file (buffer-file-name (current-buffer)))
	   (subject "Sign up for my stuff")
	   (name (mp "NAME"))
	   (to (mp "MAIL_TO"))
	   (from "Eric Abrahamsen <eric@ericabrahamsen.net>")
	   (salutation (mp "SALUTATION"))
	   (body (replace-regexp-in-string "XXXX" salutation letter-text t))) 
      (when (equal "PITCH" (mp "TODO"))
	(unless (member name my-spam-sent-names)
	  (save-excursion
	    (org-mime-compose body 'html file (concat name " <" to ">")
			      subject `((from . ,from)))
	    (message-send-and-exit)) 
	  (push name my-spam-sent-names)
	  (org-todo "WAITING")))))
  (setq org-map-continue-from (point-max))
  (widen)) 

(defun my-spam-tree ()
  (interactive)
  (let ((letter-text "long string with XXXXs in it."))
    (org-map-entries #'my-spam-subtree "TODO=\"PITCH\"" 'tree)))

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

end of thread, other threads:[~2015-08-06  6:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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