Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 24. Nov 2024, 01:09

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: 26. Oct 2009, 14:00 
Offline

Joined: 26. Oct 2009, 12:38
Posts: 7
Hello, I am wondering if it is possible to set the JFU component up to send an email to the uploader as well as the administrator when a file is uploaded.

So far when a user uploads a file I (as the administrator) get and email telling me a file has been uploaded. What I would like to happen is that the user who uploaded the file also gets an email that they have uploaded the file.

The reason is that I use the component on my Joomla website which is educational in nature. The students use the facility to send me work and some of them get anxious about whether or not the file has been sent to me correctly, despite me using the JavaScript callbacks to say a file has been uploaded successfully.

Is this possible?

I am using Joomla 1.5.14 and JFU 2.9.1 (Registered)

Many thanks


Top
 Profile  
 
 Post subject:
PostPosted: 26. Oct 2009, 14:09 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Hi,

yes, you can implement a simple e-mail plugin. There you can send e-mails how you like. You can use the log plugin as example. Because there the e-mail of the user is already available.

http://www.tinywebgallery.com/en/tfu/web_plugin.php

Best,
Michael


Top
 Profile  
 
 Post subject:
PostPosted: 27. Oct 2009, 11:50 
Offline

Joined: 26. Oct 2009, 12:38
Posts: 7
OK, I added the following code to log_plugin.php

Code:
// email confirmation sent to user
$subject = "You have uploaded files to my website";
$body = "Hi,\n\nYou have uploaded the following files to my website: $filename";
mail($useremail, $subject, $body);


saved the file, logged into Joomla and uploaded a file, but it didn't send an email. I then tried:

Code:
// email confirmation sent to user
$to = "me@something.com";
$subject = "You have uploaded files to my website";
$body = "Hi,\n\nYou have uploaded the following files to my website: $filename";
mail($to, $subject, $body);


but that hasn't worked either (incidentally I did put my email address in the $to variable :wink:)

Am I missing something?


Top
 Profile  
 
 Post subject:
PostPosted: 27. Oct 2009, 11:58 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
the log plugin is called? - do you get someting in the log file?


- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 27. Oct 2009, 16:55 
Offline

Joined: 26. Oct 2009, 12:38
Posts: 7
Yes, it seems to be called. I have had some small success. Using the following:

Code:
// email confirmation sent to user
$to = "me@something.com";
$subject = "You have uploaded files to my website";
$body = "Hi,\n\nYou have uploaded the following files to my website: $filename";
mail($to, $subject, $body);


did seem to work, and produced the following in the tfu.log:

Code:
10.27.2009 15:36:00 - testuser | RDC16(08-09)Student Progress Report form - Student.doc | ./../../../../studentfolders/fd_year1/testuser | ./../../../../studentfolders/fd_year1/testuser/RDC16(08-09)Student Progress Report form - Student.doc | 237


But when I try to use the $useremail variable to send an email to the logged in user nothing is happening still.


Top
 Profile  
 
 Post subject:
PostPosted: 27. Oct 2009, 16:58 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
as you see in the log TFU_USER_EMAIL is not set in the session.

have you set the session handler to none?

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 27. Oct 2009, 17:03 
Offline

Joined: 26. Oct 2009, 12:38
Posts: 7
In Joomla > Global Configuration > System the session handler is set to None.


Top
 Profile  
 
 Post subject:
PostPosted: 27. Oct 2009, 17:06 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
the log file looks like that no Joomla user data is set to the session.

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 27. Oct 2009, 17:18 
Offline

Joined: 26. Oct 2009, 12:38
Posts: 7
Right. Any reason why that may be the case, or further sugestions I can look into?


Top
 Profile  
 
 Post subject:
PostPosted: 27. Oct 2009, 17:21 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
which version of JFU do you use?

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 27. Oct 2009, 17:23 
Offline

Joined: 26. Oct 2009, 12:38
Posts: 7
2.9.1 at the moment.


Top
 Profile  
 
 Post subject:
PostPosted: 27. Oct 2009, 17:29 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
I think there these parameters are not written to the session yet.

I just checked the history - this was added in v2.9.1.1 ;).

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 28. Oct 2009, 13:29 
Offline

Joined: 26. Oct 2009, 12:38
Posts: 7
Ok, I have updated to 2.10.4 The following code works:

Code:
// email confirmation sent to user
$to = "someone@something.com";
$subject = "You have uploaded files to Endeleo";
$body = "Hi,\n\nYou have uploaded the following files to Endeleo: $filename . $useremail";
mail($to, $subject, $body);


and produces the following in the tfu.log:

Code:
10.27.2009 20:13:06 - testuser | Iambetterthanyourkids.doc | ./__/__/__/__/studentfolders/fd_year1/testuser | ./__/__/__/__/studentfolders/fd_year1/testuser/Iambetterthanyourkids.doc | 237 | testuser testuser | someone@something.com


I have then tried the following code:

Code:
// email confirmation sent to user
$subject = "You have uploaded files to Endeleo";
$body = "Hi,\n\nYou have uploaded the following files to Endeleo: $filename . $useremail";
mail($useremail, $subject, $body);


and this produces the following in the tfu.log file:

Code:
10.28.2009 11:13:36 - testuser | MMR comments 2006.doc | ./__/__/__/__/studentfolders/fd_year1/testuser | ./__/__/__/__/studentfolders/fd_year1/testuser/MMR comments 2006.doc | 237 | testuser testuser | someone@something.com


However, I am not getting an email at the specified email address contained in the $useremail variable when a user logs in.


Last edited by rhancock on 28. Oct 2009, 17:56, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: 28. Oct 2009, 13:48 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
because th user e-mail contains an additional | for the output.

you have to directly use the session variable.

- Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy