I can't send transactional emails with a variable number of attachments. The workaround is to create several transactional email templates for each attachment amount and to specify the number of attachments in the event.