Email alert for missed call?

we want to get an e-mail alert with the CLID info when a call comes in to a particular ring group. what is the most elegant way to script this in freepbx keeping in sync with all the protocols of which files to modify and which not to ?"