Reordered mail generation logic for future extensibility (Failure at bottom, positive guards into generation, change type)
Extended to handle artifact attachments to tickets.