Xebar Saram <zelt...@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 <e...@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)))