We need an apple mail plugin for our app (peppermint) developed that does the following:
When replying to messages:
1. Adds a button "Reply by Peppermint" see here [login to view URL]
2. When you click on this button it will pop up a window which says "Recording your message" and it will start recording an audio
3. There will be another button "Attach audio" which will immediately attach the audio and add it to the message
When creating a new message:
a) There will be a button with a logo here [login to view URL]
b) When you click on it then it will pop up a message saying that it is recording a message with a button to "Attach"
c) If you click on Attach it will attach the audio file to a compose window and add some text to the subject and body of the email
You could write an applescript which will be able to generate new buttons on Apple Mail. Then this button can be set for triggering an action such as you described here. This Apple Script is probably easier than objective-C. Let me know if this method OK for you.