SugarCRM Inbound Emails

I’ve just recently been asked to add a logic hook to inbound emails, so that the emails could be used to be updated the associated contacts. I’m not going to provide the full details here but just a few hints.

Firstly when you set up Inbound Emails, you must make the mailbox a group mailbox, if you want to use logic hooks. Non group emails go to the table email_cache not emails.

Note also that it is the scheduled task that polls the email account for new emails, so you need to wait for it run, normally once a minute.

Also, inbound emails only get imported if they remain unread. Read emails are ignored. Once Sugar has imported them, they are set as read on the server.

To setup a logic hook, you need to do it on after_save on the Emails module.

Thats all, but I can provide source if you need it.