Hi!
I'm using revo with the
http://modx.com/extras/package/fileupload2 Plugin to enable user file uploads for my site. Now i want to get informed by email each time the Fileupload Plugin is used. Is there an easy way to do this?
Thanks for helping!
Sven
[ed. note: flanger last edited this post 13 years, 10 months ago.]
I tried to put a simple mail () event to the success message in the file
/core/components/fileupload/elements/snippets/fileupload.snippet.php but that didn't change anything... hmmm.... maybe there is another file to edit?
EDIT:
okay okay - i had to put my code to the snippet... not to the core file... Now an email is send. Now i have to figure out how to get the filename and the path to my email... maybe i can do myself, but hints are still very welcome.
[ed. note: flanger last edited this post 13 years, 10 months ago.]
okay it's working. Maybe not beatiful but for now it's working. Anyone who is interested in the solution can find it here:
if ($success) {
$msg = str_replace('[[+fu.class]]','fu-success',$msg);
$un = $username = $modx->user->get('username');
$to = "[email protected]";
$subject = "FileUpload";
$body = "Hi,\n\n Es wurden Dateien von $un ins Verzeichnis $path hochgeladen. Schöne Grüße von der Webseite";
if (mail($to, $subject, $body)) {
echo("");
} else {
echo("<p>Message delivery failed...</p>");
}
} else {
$msg = str_replace('[[+fu.class]]','fu-error',$msg);