I was messing around with adding an email alert to my Tilt Hydrometer Cloud sheet (google sheet), and I came up with the following script.
If my Tilt hasn't responded within a specific amount of time, a status on my sheet will change to "Stopped". My script is looking at the status field for changes and will notify me via email when there is a change.
Here's the script that needs to be added:
function Email(e) {
var ss = SpreadsheetApp.getActive();
var sheet = ss.getSheetByName("Report");
var valueToCheck = sheet.getRange("B19").getValue();
var rangeEdit = ss.getActiveSheet();
var recipients = "
[email protected]";
var message = '';
{
message = sheet.getRange('B19'+ sheet.getActiveCell().getRowIndex()).getValue()
}
var subject = 'Fermenator Status Change: ' + valueToCheck + '';
var body = ' Fermenator status chaged to: ' + valueToCheck + ' ' ;
MailApp.sendEmail(recipients, subject, body);
};
Here's my version of the Tilt Hydrometer Cloud sheet:
https://docs.google.com/spreadsheets/d/1ax7zJedDYJd3fK8plBWHHn2lNkG1isyJXFQO8rE2H6M/edit?usp=sharing
You'll also need to set up your script to run from a trigger, with an On Edit from spreadsheet event.