A way to add Sender name on file send notification

Powerfull XFileSharing version

Moderator: admin

Message
Author
hansolo
Posts: 9
Joined: Jan 13, 2009 1:29 pm

A way to add Sender name on file send notification

#1 Postby hansolo » Jan 15, 2009 11:36 am

Hi,

I'a want to know if there is a way to customize file send notification message and add sender name or even mail address. Actually Recipient get a simple message :

Somebody sent you these files using hostname :

Any help is welcome.

User avatar
PilgrimX182
Posts: 2181
Joined: Mar 22, 2006 1:39 pm
Location: UFO Lab
Contact:

#2 Postby PilgrimX182 » Jan 16, 2009 1:20 pm

This message is in confirm_email_user.html template.
No way to put sender name there now.

hansolo
Posts: 9
Joined: Jan 13, 2009 1:29 pm

#3 Postby hansolo » Jan 16, 2009 1:33 pm

Tks, I already managed to find a way to put sender address in the subject.

I want also that a user be notified when someone download one if his files.

Is there a way to do that?

ozmo
Posts: 15
Joined: Apr 14, 2009 3:34 am

#4 Postby ozmo » Apr 28, 2009 9:48 am

hansolo wrote:Tks, I already managed to find a way to put sender address in the subject.

Would you mind sharing how you achieved this?

hansolo wrote:I want also that a user be notified when someone download one if his files.

Is there a way to do that?

Any luck with this option?

Thanks,
ozmo

hansolo
Posts: 9
Joined: Jan 13, 2009 1:29 pm

#5 Postby hansolo » Apr 28, 2009 10:45 am

Yeah, no problem, below the code i have added in UploadResult function :

Add this after : my $usr_login = $ses->getUser->{usr_login} if .....
----------
my $FROMemail = $c->{email_from}; # create new variable with default sender address
if ($ses->getUser) # check if it's anonymous
{
$FROMemail = $ses->getUser->{usr_email}; # if not anonymous then get user email
}


Then replace :

$ses->SendMail( $f->{link_rcpt}, $c->{email_from},....

with :

$ses->SendMail( $f->{link_rcpt}, $FROMemail,....

I managed also to put Sender address in mail text message by adding FROMemail to the template variables :
$tmpl->param('FROMemail' => $FROMemail);
before calling SendMail.

Then you will be able to call FROMemail by adding <TMPL_VAR FROMemail> tag in "confirm_email_user.html".

PS : You can rename FROMemail variable to what you want.

Hope this could help.

ozmo
Posts: 15
Joined: Apr 14, 2009 3:34 am

#6 Postby ozmo » Apr 28, 2009 11:29 am

Hi hansolo,

Thanks for the quick response.

I understand what you have done here however, I am unable to find the first line (my $usr_login = $ses->getUser->{usr_login} if .....) within the index.cgi

I see the second part of your script to be amended within the index.cgi

Am I looking in the wrong area?

Thanks,
ozmo

hansolo
Posts: 9
Joined: Jan 13, 2009 1:29 pm

#7 Postby hansolo » Apr 28, 2009 12:32 pm

Yeah, the code have to be added to UploadResult fonction in index.cgi

ozmo
Posts: 15
Joined: Apr 14, 2009 3:34 am

#8 Postby ozmo » Apr 28, 2009 12:53 pm

hansolo wrote:Yeah, the code have to be added to UploadResult fonction in index.cgi


Ok thanks again, but I am unable to find the following code within index.cgi

Code: Select all

my $usr_login = $ses->getUser->{usr_login} if .....

hansolo
Posts: 9
Joined: Jan 13, 2009 1:29 pm

#9 Postby hansolo » Apr 28, 2009 3:30 pm

It doesn't matter, that line should be located after :
my $status = &ARef($f->{'st'});
at variable declaration phase of UploadResult function :
my $usr_login = $ses->getUser->{usr_login} if $ses->getUser && $ses->getUser->{usr_add_login};


Return to “XFileSharing Pro”

Who is online

Users browsing this forum: No registered users and 0 guests