XUpload - Dynamic Email Subject Line

Message
Author
iamheaddown
Posts: 6
Joined: Oct 17, 2006 3:22 pm

Dynamic Email Subject Line

#1 Postby iamheaddown » Apr 23, 2007 3:43 pm

I am using XUpload Pro version 2.2 and would like to know how I can insert a variable from my upload form into the subject line of the confirmation email??

I have added a 'company' input into the upload form. I would like the subject line of the confirmation email to dynamically insert the company name from the 'company' input from my upload form like below:

Subject: File Uploaded: GE Electric

The XUploadConfig.pm file has the following code for the subject line:

Code: Select all

 # Subject for email notification
 email_subject      => "File Uploaded",
Please let me know what code will accomplish my request. Thanks.

:D

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#2 Postby PilgrimX182 » Apr 24, 2007 5:28 am

It's easy. In upload.cgi replace this line of code

Code: Select all

&SendMail( $c->{confirm_email}, $c->{confirm_email_from}, $subject, $tmpl->output() );
with

Code: Select all

&SendMail( $c->{confirm_email}.$cg->param('company'), $c->{confirm_email_from}, $subject, $tmpl->output() );
and set 'email_subject' option in config to "File Uploaded: ",

iamheaddown
Posts: 6
Joined: Oct 17, 2006 3:22 pm

Problems now.

#3 Postby iamheaddown » Apr 24, 2007 2:41 pm

I changed the line as you suggested and now XUpload does not work. Any thoughts, I noticed the upload.cgi rights had changed to Apache{48} vs. root{0}.

I changed the rights back to root(0) and still no luck. Stuck.

:?

iamheaddown
Posts: 6
Joined: Oct 17, 2006 3:22 pm

SOLVED.

#4 Postby iamheaddown » Apr 24, 2007 3:31 pm

My bad,

Very important step, make sure all windows line breaks are removed in your .cgi files before you upload them to your server.

For people who want to remove the new line breaks, here is a link in one of the sticky posts from this forum.

http://sibsoft.net/cgi-bin/Tools/nl.cgi

Thanks.
:D

iamheaddown
Posts: 6
Joined: Oct 17, 2006 3:22 pm

Follow-up

#5 Postby iamheaddown » Apr 24, 2007 4:05 pm

OK. Now that I have the errors cleaned up, I have made the code changes that Pilgrim suggested. If I enter a company name in the input box, no email is sent. If I leave the company name input box empty, an email is sent.

Any ideas??

:(

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#6 Postby PilgrimX182 » Apr 25, 2007 5:28 am

Oh, sorry! Now my bad :) Added company field to wrong variable.

Here's correct code:

Code: Select all

&SendMail( $c->{confirm_email}, $c->{confirm_email_from}, $subject.$cg->param('company'), $tmpl->output() );