The Google Drive API has support for PHP. You can use it to make a query, through an asynchronous task written in PHP, to check daily changes in the directory and send emails according to its rules. This API will also serve to integrate with your system.
In this article from Google, you can follow step by step how to use the API.
See the following example, contained in the link 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 did not understand if what you need is to send email only in the absence of file sharing, or it is absence in the creation or modification of the file, but for both, you can do by passing the correct parameters in $optParams['Fields'], are they modifiedDate and sharedWithMeDate. Then you handle the result and send the emails you need.
At this link, you can use Try it, at the bottom of the page, to check the extra parameters available in the listFiles method call.
Alisson, explain your problem better, not understand it properly, what do you mean, go a day without sharing? And could you add what you tried to do? Thank you
– David