0

I want to get an email notification sent to me from the site when someone fills out form and downloads content from my site. How can I do that?

2 Answers 2

1

Use the Email from Template add-on and include either on the page offering the download button, on a confirmation page after clicking button, or trigger via an ajax call on clicking the download button (along with firing the download).

0

One way, there are probably plenty more, is via PHP in the form when it is submitted. Remember, for this you would need to enable PHP on INPUT for the Form. I am sure that a LOT of people on this Forum would cringe with this approach, but as I said, this is one way.... Also, this is using the POST not the GET method....

<?php
   if ($_SERVER['REQUEST_METHOD'] == 'POST')
    { 
         $to = "[email protected]";
         $subject = "This is subject";

         $message = "<b>This is HTML message.</b>";
         $message .= "<h1>This is headline.</h1>";

         $header = "From:[email protected] \r\n";
         $header .= "Cc:[email protected] \r\n";
         $header .= "MIME-Version: 1.0\r\n";
         $header .= "Content-type: text/html\r\n";

         $retval = mail ($to,$subject,$message,$header);

         if( $retval == true ) {
            echo "Message sent successfully...";
         }else {
            echo "Message could not be sent...";
         }

    }
      ?>

Your HTML code would follow the "?>".  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.