Announcement

Collapse
No announcement yet.

modifying contact us page

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

    modifying contact us page

    Hi

    Can anyone help me sort out where I have gone wrong. I modified our contact us page (and mailform.pl) sometime ago to incorporate an additional field. having just upgraded to 7.0.5 I have gone back into mailform.pl to carry out the minor change again.

    But alas, it does not appear to work, I can restore original files and all ok so must be something I have done but cannot see what.

    I enclose both contact_us and mailform (both as txt files) for your purusal.

    The website is http://www.chancellor.co.uk

    Many thanks in anticipation

    Regards
    Brian
    Attached Files

    #2
    bump bump

    Have re-checked the code again, must be something obvious, anyone

    Comment


      #3
      Hi,

      Did you update / refresh the site once you made the changes to the script? I would try a refresh to see if it works. I have had a look at the attached files and cannot see what could be causing the issue.

      Kind regards,
      Bruce King
      SellerDeck

      Comment


        #4
        Hi Bruce

        Yes I did a complete site refresh, still got errors. I then put back the the mailform.pl and contactUs.html files that were used in 7.0.3 prior to upgrade and refreshed again, same problem these no longer worked.

        I have uploaded the new versions that came with 7.0.5 without the additional field for the moment and all works ok.

        I noted on the upgrade log that Actinic had modified mailform.pl in 7.0.5 lines 208 - 211 and line 268. I am not a perl man so unable to fathom out changes.

        Have you been able to add an extra field (such as Company name0 to the contactUs page on your test sites since 7.0.5?

        Regards
        Brian

        Comment


          #5
          Hi Brian,

          Here are some instructions that I've used in the past to add new fields to the contact us form, they may help:

          - go to 'Advanced | Template Manager | Other Pages tab (click 'Change View' if you do not see the tabs) | Contact Us button' to open the 'contact us' form

          - add a new row where you want the field to display using the following code:

          <tr>
          <td>&nbsp;</td>
          <td>My New Field Name:</td>
          <td> <input type="TEXT" name="MyNewField" size="50" maxsize="125" value="">
          </td>
          </tr>

          - if the field is to be required then change the field prompt to look like:

          <td><span class="actrequiredcolor">My New Field Name:</span>*</td>

          -close and save the file

          - open 'Windows Explorer' and browse to c:\program files\actinic v7\sites\<site name>
          - open 'MailForm.pl' in a text editor such as notepad
          - search for: sub SendMailToMerchant
          - you need to create a variable for each extra field that you want to display, so after

          $sSubject = $::g_InputHash{'Subject'};

          add a similar line for each field, for example:

          $sMyNewField = $::g_InputHash{'MyNewField'};

          - then search for: # Construct the mail text and send it to the merchant
          - you need to add a line for each field after:

          $sTextMailBody .= ACTINIC::GetPhrase(-1, 2373) . "\r\n" . $sMessage . "\r\n\r\n";

          for example:

          $sTextMailBody .= "MyNewFieldName:" . $sMyNewField . "\r\n";

          - then directly after these new fields you should see:

          my @Response = ACTINIC::SendMail($::g_sSmtpServer, $$::g_pSetupBlob{EMAIL}, $sSubject, $sTextMailBody, $sEmailRecpt);

          - you need to add in your new variables so they are sent with the email,
          for example:

          my @Response = ACTINIC::SendMail($::g_sSmtpServer, $$::g_pSetupBlob{EMAIL}, $sSubject, $sTextMailBody, $sEmailRecpt, $sMyNewField);

          - a little further down you should see the above line again - under:

          # Send the same message to the sender
          # Withe a "thank you" prefix

          - make the same change

          - if you want to may your new field to be required then you need to search
          for:

          if ($sEmailRecpt eq "")
          {
          $sError .= ACTINIC::GetRequiredMessage(-1, 2371);
          }

          - copy this code and paste it directly after it and change the relevant parts, ie:

          if ($sMyNewField eq "")
          {
          $sError .= "<b>'My New Field'</b> is required</br>";
          }

          - save and close the file
          - update your site.
          ********************
          Tracey
          SellerDeck

          Comment


            #6
            Hi Tracey

            Thanks for your help. Unfortunately I have tried using your script to add on field to our form and have encountered error 500 (internal CGI error).

            I have tried twice from scratch with the same result, I enclose copies of both files. The field I am trying to add is "Company" underneath user name.

            regards
            Brian
            Attached Files

            Comment


              #7
              Hi Brian,

              I tried it out myself and got the same error. Sorry, but I seem to have missed one step out.

              In the same script search for:

              # Receive parameters from input hash
              #
              my ($sEmailRecpt, $sSubject, $sTextMailBody, $sName, $sMessage, $sHTML);

              add in $sMyNewField, so it looks something like:

              # Receive parameters from input hash
              #
              my ($sEmailRecpt, $sSubject, $sTextMailBody, $sName, $sMessage, $sMyNewField, $sHTML);
              ********************
              Tracey
              SellerDeck

              Comment


                #8
                Hi Tracy

                Thanks for your perseverance but unfortunately although I have gone one step further, we get an error message -
                Error Returned from SMTP server (4: Senders address rejected: need fully qualified address)
                The senders email is valid.
                I have also attached the latest mailform.txt file.

                Although we get the error we do receive the email, but the sender does not get their copy.

                Regards
                Brian
                Attached Files

                Comment


                  #9
                  Hi Brian,

                  I've dropped your script into my software and uploaded it to my local server and it worked. I can only assume that your SMTP server is rejecting the address for some reason.
                  ********************
                  Tracey
                  SellerDeck

                  Comment


                    #10
                    Hi Tracy

                    I thought that, but cannot understand why it works when I put back the orginal ContactUs.html and mailform.pl, there must be something in the perl script that I have changed?

                    regards
                    Brian

                    Comment


                      #11
                      Is it possible to get custom fields to retail values that have been entered if the page reloads because of an error?

                      Comment


                        #12
                        Is it possible to get custom fields to retail values that have been entered if the page reloads because of an error?
                        Sorry but I can't get this to happen because there is no variable for the custom fields (even creating a custom variable didn't work).
                        ********************
                        Tracey
                        SellerDeck

                        Comment


                          #13
                          Hi Tracey,

                          I had a tinker with customvariables too and got nowhere. Thank you for having a go

                          Comment

                          Working...
                          X