I doubt that you will find any API/library with this functionality.
Combining messages "in a reasonably intelligent manner" will prove to be virtually impossible for a library knowing absolutely nothing about the nature of the content.
Using mailgun for sending mail is a very robust option - the throttling you mention is something you will have to add yourself.
If the messages are being pumped out at any rate you will need to introduce a waiting period to see if another message is coming. Knowing nothing about the rate of messages you will have to introduce delays if you have just sent a message (after waiting) when a new arrives.
If the system schedules messages for sending - eg. sending status messages at night/morning to users it might be a better approach to combine the messages before they are turned into actual e-mails.