From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Mail merge in isodoc class (with datatool... and Org) Date: Wed, 22 Sep 2010 00:02:15 +0200 Message-ID: <871v8mhi1k.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Eric, Going on within the _tangle_ route, I've managed getting *mail merge* worki= ng from Org, by using the =3Disodoc=3D class with the LaTeX package =3Ddatatoo= l=3D. --8<---------------cut here---------------start------------->8--- #+TITLE: Org-isodoc #+AUTHOR: Seb Vauban #+DATE: 2010-09-21 #+LANGUAGE: en_US * To :PROPERTIES: :ID: bfd9e2af-1033-4bf0-a0d1-5757afd9c9a1 :END: #+begin_src csv :tangle addresses.csv FirstName,LastName,Address,PostCode,Town Albert,ARTHUR,Rue1,1100,Albertville Beatrice,BENJAMIN,Rue2,2020,Bigard Christophe,CASTAGNE,Rue3,3003,Calais Damien,DURAND,Rue4,4440,Dunkerque #+end_src * Subject :PROPERTIES: :ID: 72e05a4c-13b5-48e3-b326-8868a7ab0f09 :END: #+srcname: subject #+begin_src org :results latex Composing letters using Org mode and the LaTeX isodoc class #+end_src * Opening :PROPERTIES: :ID: 123be106-665b-4da9-9009-769987713f87 :END: #+srcname: opening #+begin_src org :results latex Dear Org mode users, #+end_src * Body :PROPERTIES: :ID: 3ccb6126-c3d4-4e5f-b630-ef3086d15ca2 :END: #+srcname: body #+begin_src org :results latex *Problems* encountered /so far/: - how to insert properly converted tables (to LaTeX)? | test | hello | | foo | bar | - begin an Org block, editing this code adds commas in front of every line.= .. That's all for now. #+end_src * Closing :PROPERTIES: :ID: 53486f96-916a-4900-9e01-c27e9661d184 :END: #+srcname: closing #+begin_src org :results latex Yours Truly #+end_src * Encl :PROPERTIES: :ID: 61870a22-46b7-4446-ab0f-c17ebb36c632 :END: #+srcname: encl #+begin_src org :results latex I still have to look at how to declare some attached documents. #+end_src * Letter :PROPERTIES: :ID: b9db447c-0347-414e-a555-edf2ddafdbc3 :END: #+begin_src latex :noweb yes :tangle yes \documentclass[11pt]{isodoc} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage{datatool} \DTLloaddb{addresses}{addresses.csv} \usepackage{isodoc-style} \setupdocument{ subject =3D {% <>}, opening =3D {% <>}, closing =3D {% <>} } \begin{document} \DTLforeach{addresses}{% \firstname=3DFirstName,% \lastname=3DLastName,% \addressi=3DAddress,% \postcode=3DPostCode,% \town=3DTown% }{% \letter[to=3D{\firstname~\lastname\\\addressi\\\postcode~\town}]{% <> }} \end{document} #+end_src --8<---------------cut here---------------end--------------->8--- I'm sure there are other ways, as you said... >> next step: be able to produce /mail merge/ ("publiposting"), having in O= rg >> the list of recipients and the letter's contents -- both in one unique O= rg >> file --, and producing all the letters at once (in one PDF), just by =3D= C-c >> C-v C-e=3D... > > this shouldn't be impossible with the current setup, maybe use sbe to cal= l a > code block on every row of a table with the table holding the recipients. > Certainly wouldn't be trivial though. ... but this is a first (working) step! Comments, patches, ideas, better ways... all are welcome... Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode