The Google Drive API has support for PHP. You can use it to query through an asynchronous task written in PHP to check daily directory changes and send emails according to your rules. This API will also serve to integrate with your system.
In this article from Google, you can follow the step-by-step how to use the API.
See the following example, contained in the link given above:
// Get the API client and construct the service object.
$client = getClient();
$service = new Google_Service_Drive($client);
// Print the names and IDs for up to 10 files.
$optParams = array(
'pageSize' => 10,
'fields' => "nextPageToken, files(id, name)"
);
$results = $service->files->listFiles($optParams);
if (count($results->getFiles()) == 0) {
print "No files found.\n";
} else {
print "Files:\n";
foreach ($results->getFiles() as $file) {
printf("%s (%s)\n", $file->getName(), $file->getId());
}
}
I do not understand if what you need is to send email only in the absence of file sharing, or it is absence in creating or modifying the file, but for both, you can do by passing the correct parameters in $ optParams ['fields'], they are modifiedDate and sharedWithMeDate . Then you'll get the results and send the emails you need.
In this link you can use Try it at the bottom of the page to check the extra parameters available in the listFiles method call.