% 12pt default for scrlttr2
\documentclass{scrlttr2}

% \NewDocumentCommand{\foo}{m +m}
% {
%   \IfFileExists{./#1}
%   {#2}
%   {\PackageError{formletterbug}{CONFIG FILE '#1' DOES NOT EXIST - NOT CREATING FORMLETTER}{Check that the config filename  (first argument) has been correctly passed to \formletter}}
%   %{\PackageError{formletterbug}{CONFIG FILE '#1' DOES NOT EXIST - NOT CREATING FORMLETTER}{Check that the config filename  (first argument) has been correctly passed to \foo}}
% }

\ExplSyntaxOn
\NewDocumentCommand{\foo}{m +m}
{
  \file_if_exist:nTF{./#1}
  {#2}
  {\PackageError{foo}{CONFIG~FILE~'#1'~DOES~NOT~EXIST~-~NOT~CREATING~FORMLETTER}{Check~that~the~config~filename~(first~argument)~has~been~correctly~passed~to~\formletter}}
  %{\PackageError{foo}{CONFIG~FILE~'#1'~DOES~NOT~EXIST~-~NOT~CREATING~FORMLETTER}{Check~that~the~config~filename~(first~argument)~has~been~correctly~passed~to~\foo}}
}
\ExplSyntaxOff

% Parameters for document commands
\newcommand{\addressesconfigfilename}{fifmacroerr.txt}

\begin{document}
\newcounter{letternum}
\foo{\addressesconfigfilename}
{
  Text
}
\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-engine: luatex
%%% TeX-master: t
%%% End:
