From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: create a "send plain text/pdf email with current header" function? Date: Thu, 06 Aug 2015 14:24:17 +0800 Message-ID: <871tfhylwu.fsf@ericabrahamsen.net> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNEbX-0001Qh-LZ for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 02:24:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNEbT-0000di-2c for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 02:24:39 -0400 Received: from plane.gmane.org ([80.91.229.3]:32903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNEbS-0000dP-Sa for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 02:24:35 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZNEbM-0005JD-FT for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 08:24:28 +0200 Received: from 221.220.62.166 ([221.220.62.166]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Aug 2015 08:24:28 +0200 Received: from eric by 221.220.62.166 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Aug 2015 08:24:28 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Xebar Saram 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 ") (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)))