email notification: new file

Hello,

first of all, thank you for the great tool.

I use pp often to share files with my clients. Is it possible to get an e-mail notification when a new file has been uploaded? Is there a way to copy it from "New messages"?

I really miss this notification.

Thanks for your help!

For those looking to send emails when a file is uploaded, if found a working way, maybe someone will arrange this code, its a bit of a mess :p

The following code will send a mail to everyone working on the project.

Open application/controllers/FilesController.class.php.

After line 408 (DB::commit();) add the following lines:

// **********************************************

foreach (active_project()->getCompanies() as $company) {
if (is_array($users = $company->getUsersOnProject(active_project())) && count($users)) {

foreach ($users as $user) {

$user_mail = clean($user->getEmail());

$success = Notifier::sendEmail($user_mail, Notifier::prepareEmailAddress(logged_user()->getEmail(), logged_user()->getDisplayName()), "Upload notice in project " . clean(active_project()->getName()), "I just uploaded a new file : ----- " . array_var($uploaded_file, 'name') . " ----- inside project " . clean(active_project()->getName()) . "\n\nPlease have a look at it!\n\n" . html_entity_decode(active_project()->getOverviewUrl()) . "\n\n\n\n" . logged_user()->getDisplayName() );
} // foreach

} // if
} // foreach

// **********************************************

Cheers