I'm creating custom email notifications and I'm a little confused as to how the variables are passed, using <TMPL_LOOP> or <TMPL_VAR NAME="PARAMETER_NAME"> or <input name=param type=text value="<TMPL_VAR NAME="PARAM">">...
I just want to stick in the filename in one spot within an html emal.
Also, the bigger question, can I pass field info from the upload form that I've created into the email? For instance, I've added a "description" field into the form, can I pass just this field into the email without doing the whole Upload Parameters block?
Thanks!
XUpload - Passing form fields into custom confirmation email...
I received this email from sibsoft, but it doesn't address placing individual form field information in the confirmation email. For instance, in the customer email, I don't want to pass all of the fields in my custom upload form. BUT, maybe I just want to place the field "name". How can I pull the individual fields to put them in the template?
In upload.cgi need after string:
$tmpl->param('files' => \@files,
Need to add:
'params' => \@har,
This is an array of parameters passed in addition. In order to print all of
params passed you should add following code in template:
<TMPL_LOOP params>
<TR<TMPL_IF style> class="style<TMPL_VAR style>"</TMPL_IF>><TD width="1%"
nowrap><TMPL_VAR name>:</TD><TD><TMPL_IF value2><TMPL_VAR
value2><TMPL_ELSE><TMPL_VAR value></TMPL_IF></TD></TR>
</TMPL_LOOP>
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
in upload.cgi
above $tmpl->param(.... add
now you can add tags like <TMPL_VAR description> into email template,they will be replaced with your custom fields values.
above $tmpl->param(.... add
Code: Select all
$tmpl->param($_->{name} => $_->{value}) for @har;
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
In xupload.js find
and add below something like this:
where myfield is name of your custum field.
You can add multiple lines like this.
Code: Select all
if(NF==0){alert('Select at least one file to upload');return false;};
Code: Select all
if(f1.myfield && f1.myfield.value==''){alert("myfield required");return false;}
You can add multiple lines like this.