Announcement

Collapse
No announcement yet.

MailForm.pl Update Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    MailForm.pl Update Problem

    Hi all,

    In the process of putting a new Actinic site together and have customised the Contact Form as per various posts on this forum and in the Knowledge Base.

    However, when I publish the site to the trial server and complete the new form (which looks absolutely fine), the email I receive ignores the updated Mailform.pl file.

    I'm not getting any errors and the email I'm receiving includes fields which I've removed from the form, so it suggests that MailForm.pl isn't being updated for some reason.

    I've done the usual - Purge & Refresh, reverted to original and started over, but to no avail.

    You can see the trial site here: http://trials.actinic.com/trials/trial57718/

    Choose 'Request A Catalogue' to see the modified form.

    And the content of my amended Mailform.pl file is as follows:

    Code:
    sub SendMailToMerchant
    	{
    	#
    	# Receive parameters from input hash
    	#
    	my ($sEmailRecpt, $sTextMailBody, $sName, $sHTML, $sTitle, $sEmailAddress, $sAddressLine1, $sAddressLine2, $sAddressLine3, $sTown, $sCounty, $sPostcode, $sMailCountry, $sMailingListOptIn, $sThirdPartyOptIn);
    	$sName 			= $::g_InputHash{'Name'};
    	$sTitle 		= $::g_InputHash{'Title'};
    	$sEmailAddress 	= $::g_InputHash{'EmailAddress'};
    	$sAddressLine1 	= $::g_InputHash{'AddressLine1'};
    	$sTown 			= $::g_InputHash{'Town'};
    	$sPostcode 		= $::g_InputHash{'Postcode'};
    	$sMailCountry 	= $::g_InputHash{'MailCountry'};
    	#
    	# Validate the content of the fields
    	#
    	my $sError;
    	if ($sName eq "")
    		{
    		$sError .= "<strong>Your name</strong> is required<br/>";
    		}
    	if ($sEmailAddress eq "")
    		{
    		$sError .= "<strong>Your email address</strong> is required<br/>";
    		}
    	elsif ($sEmailAddress !~ /.+\@.+\..+/)
    		{
    		$sError .= "<strong>Your email address</strong> is invalid<br/>";
    		}
    	if ($sAddressLine1 eq "")
    		{
    		$sError .= "<strong>The first line of your address</strong> is required<br/>";
    		}
    	if ($sTown eq "")
    		{
    		$sError .= "<strong>The name of your town/city</strong> is required<br/>";
    		}	
    	if ($sPostcode eq "")
    		{
    		$sError .= "<strong>Your postcode / ZIP Code</strong> is required<br/>";
    		}
    	if ($sMailCountry eq "")
    		{
    		$sError .= "<strong>Your country</strong> is required<br/>";
    		}
    		
    	if ($sError ne "")
    		{
    		$sError = ACTINIC::GroomError($sError);	# make the error look nice for the HTML
    		$ACTINIC::B2B->SetXML('VALIDATIONERROR', $sError);
    		#
    		# Redisplay the mail page with error messages
    		#
    		DisplayMailPage($sName, $sEmailAddress, $sAddressLine1, $sTown, $sPostcode, $sMailCountry);
    		#
    		# Note: the above call will never return here
    		#
    		}
    	else
    		{
    		#
    		# Construct the mail text and send it to the merchant
    		#
    		$sError = ACTINIC::GetPhrase(-1, 2377);
    		$sTextMailBody .= "Name:" . $sTitle $sName . "\r\n";
    		$sTextMailBody .= "Email Address:" . $sEmailAddress . "\r\n";
    		$sTextMailBody .= "Address:" . "\r\n" . $sAddressLine1 . "\r\n";
    		$sTextMailBody .= "" . $sAddressLine2 . "\r\n";
    		$sTextMailBody .= "" . $sAddressLine3 . "\r\n";
    		$sTextMailBody .= "" . $sTown . "\r\n";
    		$sTextMailBody .= "" . $sCounty . "\r\n";
    		$sTextMailBody .= "" . $sPostcode . "\r\n";
    		$sTextMailBody .= "" . $sMailCountry . "\r\n";
    		$sTextMailBody .= "Able to send Sock Solutions brochures and offers?" . $sMailingListOptIn . "\r\n";
    		$sTextMailBody .= "Able to pass details to other companies?" . $sThirdPartyOptIn . "\r\n";
    		my @Response = ACTINIC::SendMail($::g_sSmtpServer, $$::g_pSetupBlob{EMAIL}, $sSubject, $sTextMailBody, $sTitle, $sEmailAddress, $sAddressLine1, $sAddressLine2, $sAddressLine3, $sTown, $sCounty, $sPostcode, $sMailCountry, $sMailingListOptIn, $sThirdPartyOptIn);
    		if ($Response[0] != $::SUCCESS)
    			{
    			ACTINIC::RecordErrors($Response[1], ACTINIC::GetPath());
    			$sError = $Response[1];
    			}
    		#
    		# Now bounce back to the mail page
    		#
    Any ideas anyone? I'm stumped.

    Thanks,
    Simon

    #2
    are you definitely editting the script in your SITE folder?
    Sorry, if that's a daft question but it's something to check.
    I use a modded form on some sites and don't have a problem with it.
    Tracey

    Comment


      #3
      if your using vista and have not setup actinic under the my documents folder then it will undo any changes you make, as tracey said make sure you edit the scripts under your site1 folder

      Comment


        #4
        Originally posted by Darren B View Post
        if your using vista and have not setup actinic under the my documents folder then it will undo any changes you make, as tracey said make sure you edit the scripts under your site1 folder

        I'm on XP and, yes, definitely editing the MailForm.pl in the correct site folder.

        Just double-checked to be sure!

        Comment


          #5
          is it ALL the additional fields that aren't working? Or just some?
          Tracey

          Comment


            #6
            Originally posted by TraceyHand View Post
            is it ALL the additional fields that aren't working? Or just some?
            All of them. There's no evidence of the updated MailForm.pl file being acknowledged by the system at all.

            I get no extra error messages when I fail to fill in the new fields and the format of the email I'm receiving on successful submission of the form is as it would be with a 'standard' MailForm.pl file (ie. Subject, Name, Email Address, Message fields only) - this is despite me having removed both the Subject & Message fields from the email in the revised MailForm.pl file.

            As I say - it seems to point to the fact that the MailForm.pl changes aren't being picked up for some reason.

            Comment


              #7
              ok..few things to try

              1)The steps in the second to last post in THIS THREAD

              if that doesn't work..

              2) Revert back to standard form and make modifications as shown in THIS POST
              Tracey

              Comment


                #8
                Originally posted by TraceyHand View Post
                ok..few things to try

                1)The steps in the second to last post in THIS THREAD

                if that doesn't work..

                2) Revert back to standard form and make modifications as shown in THIS POST
                Righto.. I've set out to look at the first of the two suggestions and, as per the other post, I've looked for the mf00001.pl file to delete... only to discover that it doesn't exist in the site folder for the site I'm working on.

                I'm running Actinic Designer and this is the second site I'm working on. I therefore have two site folders:

                /Site 1/ - which is the first site I've built, not the one I'm having a problem with. This folder has an mf00001.pl file in it.

                /Sock Solutions/ - which is the site I'm working on but which doesn't have an mf00001.pl.

                I can't therefore complete the suggestion Chris has made in his post, but it sounds like a very similar problem.

                Hmmm...

                Comment


                  #9
                  Originally posted by RidgewayStudios View Post
                  I've looked for the mf00001.pl file to delete... only to discover that it doesn't exist in the site folder for the site I'm working on.
                  In fact, this is true of all the .pl scripts which look to be generated on publication of the site.

                  Could it be that Actinic is using the default scripts in the Site 1 folder for multiple web sites for some reason?

                  Comment


                    #10
                    no, running multiple sites shouldn't make a difference. Many of us do it!

                    Try removing the .pl files from the SERVER (it'll be in your cgi-bin, I think) and re-uploading (or refreshing)
                    Tracey

                    Comment


                      #11
                      Originally posted by RidgewayStudios View Post

                      /Site 1/ - which is the first site I've built, not the one I'm having a problem with. This folder has an mf00001.pl file in it.

                      /Sock Solutions/ - which is the site I'm working on but which doesn't have an mf00001.pl.
                      This is certainly odd. Am would imply that the site hasn't been uploaded (mailform.pl not generating a mf00001.pl) I'm wondering if it's something to do with being on trial hosting. Is the site in test mode?
                      Perhaps either of these things affects it.
                      I assume there isnt am mf0000...etc.pl at ALL in the Sock Solutions site folder then?
                      You could try forcing a Web > Generate scripts to see if it generates one?
                      Tracey

                      Comment


                        #12
                        Originally posted by TraceyHand View Post
                        This is certainly odd. Am would imply that the site hasn't been uploaded (mailform.pl not generating a mf00001.pl) I'm wondering if it's something to do with being on trial hosting. Is the site in test mode?
                        Perhaps either of these things affects it.
                        I assume there isnt am mf0000...etc.pl at ALL in the Sock Solutions site folder then?
                        You could try forcing a Web > Generate scripts to see if it generates one?
                        The site is currently in 'live' mode, not test mode and, no, there's not a single mf000... or md000 or any such file in the Sock Solutions folder at all.

                        I also can't Web > Generate scripts.. the option is greyed out.

                        I can get it up onto the future live server and then delete the .pl scripts, but it's going to take a while to get domains and subdomains configured to make that possible. Certainly not something I'm going to be able to do immediately.

                        Might give Actinic support a prod in the morning and see what they think, I reckon.

                        Thanks for all your help - if you have a brainwave, let me know!

                        Comment


                          #13
                          that is strange. I can't help wondering if it's something to do with the trial hosting.
                          Did you try deleting the mf00001.pl file on the server itself (not your site folder) via FTP, as the person in the other linked post did?

                          Not sure why your 'generate scripts' would be greyed out either.

                          Best call Actinic, I suppose! Sorry I could be more help
                          Tracey

                          Comment


                            #14
                            Originally posted by TraceyHand View Post
                            that is strange. I can't help wondering if it's something to do with the trial hosting.
                            Did you try deleting the mf00001.pl file on the server itself (not your site folder) via FTP, as the person in the other linked post did?

                            Not sure why your 'generate scripts' would be greyed out either.

                            Best call Actinic, I suppose! Sorry I could be more help
                            Because it's on trial hosting, I can't FTP in to delete the file (as far as I know), hence the need to get it on the live box before I'll be able to get a definite answer to this.

                            I've dropped Actinic a support request, hopefully they'll solve it in the morning!

                            Thanks Tracey - don't work too late!

                            Comment


                              #15
                              no probs. Hopefully some bright spark in Support will know straight away what the problem is
                              Tracey

                              Comment

                              Working...
                              X