Notification about new email

48 views
Skip to first unread message

Fabian Jäger

unread,
Mar 22, 2014, 3:32:28 PM3/22/14
to apple-m...@googlegroups.com
Dear Mail experts,
does anybody know of a function that is being called whenever a new email has been received? It would be optimal if this function has direct access to the newly received email/message object. Depending on some message attribute, I would like to perform a custom action and that's why I need this specific trigger...

Thanks in advance,
Fabian

Mitchell Johnson

unread,
Apr 27, 2015, 2:37:15 PM4/27/15
to apple-m...@googlegroups.com
Parsed Message with context is called in MimePart for the snippet generation. That should do what you want. The caveat is that its also called to decode all messages. 
You can see the full stack trace attached.

You can get the current message with 

MCMessage *message = (MCMessage*)[(MCMimeBody *)[self mimeBody] message];
Screen Shot 2015-04-27 at 11.33.34 AM.png
Reply all
Reply to author
Forward
0 new messages