| View previous topic :: View next topic |
| Author |
Message |
jimrws
Joined: 05 Feb 2008 Posts: 20
|
Posted: Jun 02, 2008 3:00 pm Post subject: Displaying the email variables with labels |
|
|
Hi,
Currently in the email template, the 'other form variables' appear together in a big chunk and use the variable name as a label for the value. These other variables just appear from a loop and there's no way to break them up and use them individually.
I'd like to be able to specify these variables and display them next to my own labels, or mix the variables with my own text.
In the past I have done something like this in php quite easily. But I don't know Perl at all so not sure how to do this for Xupload:
| Code: |
This is how it is at the moment:
<varible name> : <variable value>
<varible name> : <variable value>
<varible name> : <variable value>
This is an example of the kind of thing I need:
"Hello" <variable value> Your address is : <variable value>
In php I would normally use something like:
<?php echo "Hello" .$_POST("Name"). "Your address is" .$_POST("Address"); ?>
How do I do this in Xupload?
|
Thanks for any help. |
|
| Back to top |
|
 |
PilgrimX182

Joined: 22 Mar 2006 Posts: 1107 Location: Undisclosed location
|
Posted: Jun 03, 2008 10:45 am Post subject: |
|
|
| What XUpload version? |
|
| Back to top |
|
 |
jimrws
Joined: 05 Feb 2008 Posts: 20
|
Posted: Jun 03, 2008 10:48 am Post subject: |
|
|
| XUpload Pro 3.0 |
|
| Back to top |
|
 |
PilgrimX182

Joined: 22 Mar 2006 Posts: 1107 Location: Undisclosed location
|
Posted: Jun 03, 2008 11:10 am Post subject: |
|
|
in upload.cgi find
| Code: | | $tmpl->param('files' => \@files, |
and add above it:
| Code: | | my %hh; $hh{$_->{name}}=$_->{value} for @har; |
then add below it:
Now you can use in your email template tags like
using names of custom variables in tags. |
|
| Back to top |
|
 |
jimrws
Joined: 05 Feb 2008 Posts: 20
|
Posted: Jun 03, 2008 1:27 pm Post subject: |
|
|
EDIT: I got it working now. This is the full block of code for anyone interested.
| Code: |
my @t = &getTime;
my $tmpl = HTML::Template->new( filename => "Templates/confirm_email.html", die_on_bad_params => 0 );
my %hh; $hh{$_->{name}}=$_->{value} for @har;
$tmpl->param('files' => \@files,%hh,
'params' => \@har,
'time' => "$t[0]-$t[1]-$t[2] $t[3]:$t[4]:$t[5]",
'total_size'=> "$ENV{CONTENT_LENGTH} bytes",
'total_size_mb' => sprintf("%.1f",$ENV{CONTENT_LENGTH}/1048576)." Mb",
);
my $subject = $c->{email_subject} || "XUpload: New file(s) uploaded";
|
Thanks for the help Pilgrim |
|
| Back to top |
|
 |
|
|
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 vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|