Interesting question. You can use an xml database in which you collect your 
contacts and how to address them. I have been doing this for over 20 years now. 
Try this for a single letter:

\startxmlsetups xml:setups
\xmlfilter{#1}{contact[@label=‘labelMaryDoe']/command(xml:contact)}
\xmlsetsetup{#1}{prefix|email|initials|address|city|telephone|information|internet|prov|informalname|formalname|telephone||formalname|mobiletelephone}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:setups}
\setuplettersection[content][alternative=setups]
\startsetups[letter:section:content]
\readtexfile{./letter-to-mycontacts.tex}{}
\stopsetups

\startxmlsetups xml:contact
    \setupletter
      
[toaddress={\switchtobodyfont[reset,10pt]\xmltext{#1}{/address/(bn|nm|st|pz|p)/command(xml:p)}
      {\switchtobodyfont[reset,kixbarc,9pt]\xmltext{#1}{/kix}}},
         opening={Dear  \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},},
         closing={Kind regards,},
         subject={Subject: How to write interesting letters},
         signature={Joseph Doe,
         \setupitemize[before=\tfx]
         {\startitemize[blacktriangle,joinedup,packed,nowhite,text]
          \item Brother of John Doe
          \stopitemize
         }}]
\relax
\placeletter
\stopxmlsetups
\setuppagenumbering [state=stop]
\starttext
\xmlprocessfile{contacts}{myaddresses.xml}{}
\stoptext

00000
my addresses.xml:

<contacts>
<contact  label='labelMaryDoe'>
<initials>M.</initials>
<formalname>Doe</formalname>
<informalname>Mary</informalname>
<prefix>Mrs</prefix>
<telephone>010-12343243</telephone>
<address>
<p>Organisation</p>
<p>T.a.v. Mrs. M. Doe</p>
<p>Long Alley</p>
<p>Shortby</p>
</address>
<email>m....@organisation.com</email>
<information>sent letter in 2024.</information>
</contact>
</contacts>

> Op 11 nov 2024, om 14:46 heeft juh+ntg-context--- via ntg-context 
> <ntg-context@ntg.nl> het volgende geschreven:
> 
> Dear all,
> 
> using this example below from 2019 to make a serial letter I get three pages.
> The second letter is split on page 2 and 3.
> 
> Are there any new approaches to make serial letters?
> 
> TIA
> juh
> 
> Am 09.04.19 um 21:38 schrieb Wolfgang Schuster:
>> \usemodule[letter]
>> \setuplettersection
>>   [opening]
>>   [alternative=setups]
>> \startsetups [letter:section:opening]
>>   \doifelse{\getvariable{address}{sex}}{male}
>>     {Dear Sir,}
>>     {Dear Madam,}
>> \stopsetups
>> \setvariable{address}{set}{\placeletter}
>> \starttext
>> \startlettercontent
>> \unknown
>> \stoplettercontent
>> \setvariables
>>   [address]
>>   [name=John,
>>    sex=male]
>> \setvariables
>>   [address]
>>   [name=Anna,
>>    sex=female]
>> \stoptext
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to