Google Apps Script trigger email notification with onEdit when cell contents changes from function
<p>I am trying to modify this script and it works when I manually change the contents of anything in A, but I would like the script to trigger when the contents of the cells in A change from what they were before from a formula I have (importXML) that's pulling data in from another site. It's just a single sheet and just the one importxml function. </p>

<pre><code>    function sendNotification() {
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var sheet = ss.getActiveSheet();
      var cell = ss.getActiveCell().getA1Notation();
      var row = sheet.getActiveRange().getRow();
      var cellvalue = ss.getActiveCell().getValue().toString();
      var recipients = "@gmail.com";
      var message = '';
      if(cell.indexOf('A')!=-1){ 
        message = sheet.getRange('A'+ sheet.getActiveCell().getRowIndex()).getValue();
      }
      var subject = 'Update to '+sheet.getName();
      var body = sheet.getName() + ' has been updated. Visit ' + ss.getUrl() + ' to view the changes on row: «' + row + '». New comment: «' + cellvalue + '». For    message: «' + message + '»';
      MailApp.sendEmail(recipients, subject, body);
    }
</code></pre>