Announcement

Collapse
No announcement yet.

Can you change the destination email addy within a manipulated contact form from SD?

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

    Can you change the destination email addy within a manipulated contact form from SD?

    Hello

    I am trying in vain to introduce a contact form on one of my fragments. I need to have this sent to a different email address to the one the main contact on the page is sent too.

    I have been entering code and playing around with PHP documents for a hand coded contact form but it will not work, so after reading through many responses to this question on this site, I tried to input the contact form already within atrinic, but I cannot seem to find a way to input a different email address destination.

    Please can anyone help me sort this dilemma, a few suggestions from people I have tried, but non so far have worked.

    Any help would be amazing.

    Thanks

    #2
    Originally posted by Vicky.Pearson View Post
    Hello

    I am trying in vain to introduce a contact form on one of my fragments. I need to have this sent to a different email address to the one the main contact on the page is sent too.

    I have been entering code and playing around with PHP documents for a hand coded contact form but it will not work, so after reading through many responses to this question on this site, I tried to input the contact form already within atrinic, but I cannot seem to find a way to input a different email address destination.

    Please can anyone help me sort this dilemma, a few suggestions from people I have tried, but non so far have worked.

    Any help would be amazing.

    Thanks
    Presumably you are trying to generate a form that will send the information collected to an email address that is not in the SellerDeck system. As SellerDeck uses Perl for its on site processing you will need Perl skills to generate an alternative page from the existing code.

    However the first route you took should have worked, firstly you need to know if PHP is installed on the web server. You can do this with a simple php file that contains

    Code:
    <?php
    echo 'PHP is installed<br />';
    ?>
    Save this in a file such as 'test.php' in your site folder on your PC, add the file name to the 'Additional files' list under the Design option of the main menu in SellerDeck, then do a 'Publish to Web'. That will get the file onto your web site in the acatalog folder (or whatever you have renamed it to). So in a web browser access www.,your domain name>/acatalog/test.php.

    If php is installed you will get the message 'PHP is installed', if so then you can use a standard php script to generate the form or even use a modified SellerDeck form where the 'action=' is set to point to your PHP code that will email the detaisl to your desired address.

    You php code will need to include the ability to email the details from the form, you could use built in PHP functions if you have the m in the version of PHP on the site or use one of the available libraries such as Swift Mailer of PHPmailer. I have used Swift mailer in custom code for SellerDeck software but if you are using the later versions of PHP like 5.4 and using OOPS coding then the PHP mailer has better facilities than Swift Mailer, I am currently using it in new extension for SellerDeck 2016.

    So you need two parts to the code, one in the fragment to generate the form using HTML not PHP, using PHP block statement is no good as that code is run by SellerDeck on your PC, in the form you need to set the form 'action=' to point to the php script that you upload to the site,if you use additional files to upload it will be in the acatalog folder on the site. The second part of your code is the written in PHP in a file in your SellerDeck site folder on your PC. This code has to extract the information passed in the $_POST variable from the form and then must email the results to your new email address.

    Malcolm

    SellerDeck Accredited Partner,
    SellerDeck 2016 Extensions, and
    Custom Packages

    Comment


      #3
      Thank you, I am giving this a go.

      Comment


        #4
        A simple hack to ACTINIC.pm may do the job using the existing form. Assuming your Fragment form has a different subject from standard, then we can tweak the Perl to look for a unique word in that subject and alter the destination address if it's found.

        First get your form working on the Fragment and test that the email is sent to the default address.

        Once that's tested, edit ACTINIC.pm and look for:
        Code:
        	($sSmtpServer, $sEmailAddress, $sSubjectText, $sMessageText, $sMessageHTML, $sReturnAddress) = @_;
        Immediately after it add:
        Code:
        	if ( $sSubjectText =~ /wowza/ )
        		{
        		$sEmailAddress = 'me@myalternativeaddress.com';
        		}
        So now any subject containing wowza will be sent to me@myalternativeaddress.com. Change to suit.

        N.B. Untested.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment

        Working...
        X