I am writing a letter in LaTeX that I want to send to a number of different recipients. The catch is that I want to send a slightly different version of the letter depending on the recipient: for example, in the letter to be sent to Ms. XX I'd like the body of the letter to say Ms. XX and in the letter to be sent to Mr. YY I'd like the body of the letter to say Mr. YY. I have searched google and can't seem to find a way to do this. Here's an example of some code:
Code: Select all
\documentclass{letter}
\signature{Me}
\address{Me \\ My address}
\begin{document}
\def \body {I'd like it to say "Ms. XX" or "Mr. YY" depending on the letter, as below.}
\begin{letter}
{Ms. XX \\ Ms. XX's address}
\opening{Dear Ms. XX:}
\body
\closing{Sincerely,}
\end{letter}
\begin{letter}
{Mr. YY \\ Mr. YY's address}
\opening{Dear Mr. YY:}
\body
\closing{Sincerely,}
\end{letter}
\end{document}