1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

A simple email responder to visitors

Discussion in 'Customizations' started by seymourjames, Sep 6, 2011.

  1. seymourjames All Hands On Deck

    One of the things I am keen to do is market stuff to people who email my site (either the admin or one of the adverts).

    Here is what you can do for the main contact form but it is exactly the same for individual advert contact forms except you modify contact.php instead and set the fromemail.

    Create a new .tpl file in your template's email folder. Lets call it visitor.tpl . The contents might look something like this

    {assign var='subject' value=$smarty.const.EMAIL_CONTACT_US_SUBJ}

    {include file="emails/html/mail_header.tpl"}

    <p>Dear {$name},</p>
    <p>Thank you for contacting our site. We would be pleased if you Bought Template Codes stuff.</p>
    <div class="hr"><hr /></div>

    {include file="emails/html/mail_footer.tpl"}


    Now in contactus.php add the code in red just under the existing lines.


    $content = "contactus.tpl";
    $msg = $Mailer->sendMail($to, $content, $vars);

    $specialmsg= "visitor.tpl";
    $vars['fromemail'] = 'no-reply@mydomain.com';
    $tmsg = $Mailer->sendMail($email, $special, $vars);
  2. seymourjames All Hands On Deck

    And if you really want to be flash you can use something like one of the modules from TemplateCodes show the latest listings where the photos will show too.

    See the screen shot attached.

    To see it live please go here

    www.frenchpropertyclassifieds.com.com/contactus.html

    Fill out the form and you should get an email from me.

    I would appreciate people hitting the google+1 button in the main menu on a couple of pages for me.

    Attached Files:

  3. seymourjames All Hands On Deck

    This idea can also be extended to the registration process. If for example you wish to classify those registering as buyers or sellers for example, it is possible to use one of the extra registration fields to ask the question on a drop down and then email different welcome messages depending on what they are. In fact a customer of ours has just used this technique and it is exactly what he needed. He wants to communicate with buyers and sellers differently - making different types of offers to each.
  4. bhavdip Customer

    Hello SeymourJames,
    I have tried doing the same thing as you mentioned in your post.
    I have created a visitor.tpl in template's email folder (templates/default/emails/html)
    and pasted the code
    {assign var='subject' value=$smarty.const.EMAIL_CONTACT_US_SUBJ}

    {include file="emails/html/mail_header.tpl"}

    <p>Dear {$name},</p>
    <p>Thank you for contacting our site. Get more benefits from our website by free registration.</p>
    <div class="hr"><hr /></div>

    {include file="emails/html/mail_footer.tpl"}


    & also pasted the code
    $specialmsg= "visitor.tpl";
    $vars['fromemail'] = 'admin@textilenow.com';
    $tmsg = $Mailer->sendMail($email, $special, $vars);

    exactly where you mentioned to paste.
    Now when I click the contact us link on my website and fill the form.... I did received the email on the email address submitted while filling the contactus form.
    But in the format as attached in this thread [IMG]
    Which means, in From section it display the Sender Name (It should display the Site Owner Name & website admin email address) & Message is empty without the text
    <p>Dear {$name},</p>
    <p>Thank you for contacting TextileNow.Com. We are Indian's largest & Biggest B2B & B2C Textile Marketplace.</p>


    Kindly help me to solve this .....
    Thank You!
  5. seymourjames All Hands On Deck

    Try allowing html emails in your 68C admin control panel. This has nothing to do with the code given.
  6. bhavdip Customer

    Its already selected "Yes" in allow HTML Emails....Now how should I do it.???
  7. seymourjames All Hands On Deck

    If you look at how send mail works you can change it to what you wish. As for html not showing I cannot say why it does not work for you. Have you looked in other email clients like outlook, mac mail, etc. Here is the code I use. I do not want to share my email so it shows no-reply@



    $to = ADMIN_EMAIL;
    $vars['name'] = $name;
    $vars['email'] = $email;
    $vars['fromemail'] = $email;
    $vars['comments'] = $comments;
    $vars['tel']=$tel;
    $content = "contactus.tpl";
    $msg = $Mailer->sendMail($to, $content, $vars);

    $special= "visitor.tpl";
    $vars['fromemail'] = 'no-reply@mydomain.com';

    $tmsg = $Mailer->sendMail($email, $special, $vars);

Share This Page