Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style type="text/css">
- @media all and (max-width: 600px)
- {
- #lftimg
- {
- display:none;
- }
- }
- </style>
- <?php
- // Or whatever the path to your app/Mage.php happens to be ...
- require_once('app/Mage.php');
- // Initialize Magento ...
- Mage::app("default");
- // Email Form Template ID in magento admin transactional emails admin page
- $templateId = 16;
- //lets see what site (US or SG) the user is on.
- $show_singapore = 'false';
- if(Mage::app()->getWebsite()->getId() != 1)
- {
- $show_singapore = 'true';
- }
- ?>
- <div class="page-title">
- <h1>
- CONTACT US
- </h1>
- <p>We would love to hear from you!</p>
- </div>
- <div style='float:left; padding-right:10px; width:90%;'><br /><br />
- $first_name = $_POST['first_name'];
- $last_name = $_POST['last_name'];
- $fullname = "$first_name $last_name";
- $emailadr = $_POST['emailadr'];
- $telephonenum = $_POST['telephonenum'];
- $comment = $_POST['comment'];
- if($first_name == '' || $emailadr == ''|| $comment== '')
- {
- echo "All fields are required, please fill out the <a href="">the form</a> again.";
- }
- else
- {
- $confirmmsg = "Hello $first_name $last_name,<br /><br />
- Thank you for contacting our company. We have received your email and will contact you back shortly.";
- // Set recepient information
- if($show_singapore =='true')
- {
- $headers = "From: staff@singapore.comrn";
- }
- else
- {
- $headers = "From: staff@usa.comrn";
- }
- $headers .= "MIME-Version: 1.0rn";
- $headers .= "Content-Type: text/html; charset=ISO-8859-1rn";
- mail($email, $subject, $confirmmsg, $headers);
- // Set sender information
- $senderName = 'Customer Service';
- $senderEmail = 'staff@usa.com';
- $sender = array('name' => $senderName,'email' => $senderEmail);
- // Set recepient information
- if($show_singapore =='true')
- {
- $recepient_email = 'staff@singapore.com';
- }
- else
- {
- $recepient_email = 'staff@usa.com';
- }
- $recepient = array('name' => 'Customer Service', 'email' => $recepient_email);
- // Get Store ID
- $store = Mage::app()->getStore()->getId();
- // Set variables that can be used in email template
- $var = array(
- 'name' => $fullname,
- 'emailadr' => $emailadr,
- 'telephonenum' => $telephonenum,
- 'comment' => $comment
- );
- $translate = Mage::getSingleton('core/translate');
- // Send Transactional Email
- try{
- Mage::getModel('core/email_template')->sendTransactional($templateId, $sender, $recepient_email, $var);
- }
- catch(Exception $e){
- print_r($e);
- }
- }
- echo "<div id='messages_product_view'>Your message has been sent!</div>";
- }
- else
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement