Hello
OK i understand but if you have such specific requirement the do one thing :
Just maintain one global Z- Table where combination of UD - selected codes along with mailer type maintain.
By using user exit during UD , call the combination according to your requirement, remaining part as it is like standard sending mail.
Z- table will help your to identify the mail format based on selected set - UD.
Regards