Do you know the average response times for the API and the email generation itself? Have any application users mentioned the process being slow?
Without more information, I can only speculate, but my advice would be to try and encapsulate this logic in an asynchronous, retriable fashion.
I believe the logic might be too heavy to be attached to a synchronous operation started by a user. I've had a similar issue on a previous project - during an approval flow, a user would click a button stating their decision, and we'd generate an email with a PDF attachment created by SQL Reporting Services. Sometimes this attachment could take 60-90 seconds to generate, and we'd see "Thread was being aborted" errors. We had to refactor the logic to add this generation to a queue, and we'd use a Timer to process the queue and send emails/generate attachments one by one. The upside of this is that since we had the data inside an Entity, we could reprocess any failed emails automatically, without the user having to intervene.