Module should provide ability to add attachment directly in mail template/text to any email sent using drupal_mail().
For example If I want to add attachment to email that user receive after registration I should just open mail .tpl.php file and insert placeholder {attach_file filename=/docs/xxx.pdf name=xxx.pdf}.
Module will work that way:
Module implements hook_mail_alter after all other mail altering modules.
In this hook it parses message text for placeholders and removes them from text.
Check mail headers and if they are not multipart/mixed, make it multipart and move message text to first part with same content type like it was.
Attach files to the mail.
If mail is already multipart/mixed then module parses it for boundaries and insert files before last one.
So module will work well with other popular modules like HTML Mail, Mime Mail etc.
What do you think about this?