I've managed to hack a small subroutine into the notification of downloads to send emails and a Discord Notification.
Just to give back to the project I'm sharing the tweaks/hacks I've made. Naturally, you may use this as inspiration to extend the options in jDownloads. (And frankly I hope you do.)
First, I've used this source as inspiration:
https://gist.github.com/Mo45/cb0813cb8a6ebcd6524f6a36d4f8862c
Secondly I've created a function around it:
function sendToDiscord($message, $username, $title, $keyvalues) {
...
}
And thirdly I've patched the function sendMailDownload from jdownloads.php in the helpers folder to include these lines:
...
// Send the Mail
$result = $mailer->Send();
/* ASSEMBLE ARRAY TO SEND TO DISCORD BOT
*/
include_once (JPATH_ROOT.DS.'myfolder'.DS.'discord.msg.send.php');
$items = '';
for ($i=0; $i<count($files); $i++) {
$items .= $files[$i]->title.' '.$files[$i]->release.'. ';
}
$arr = array(
array('name'=>'user', 'value'=>$user_name),
array('name'=>'name', 'value'=>$user_fullname),
array('name'=>'email', 'value'=>$user_email),
array('name'=>'groups', 'value'=>$user_group),
array('name'=>'files', 'value'=>$items)
);
sendToDiscord('Hi, this is a message from the Bot.', 'jDownloads', 'Download:', $arr);