MODIFICATION: Receive a copy of the email sent from visitors to listing owners.

This is a discussion on MODIFICATION: Receive a copy of the email sent from visitors to listing owners. within the Module Release forums, part of the v4 Help & Support category; Ever wanted to monitor messages that are sent from the contact form through the listing pages? I do this myself ...


Go Back   68 Classifieds Forums > v4 Help & Support > Module Release

 
LinkBack Thread Tools Display Modes
  #1  
Old 04-04-2008, 10:05 AM
cwp's Avatar
cwp cwp is offline
Senior Member
 
Join Date: Jun 2007
Posts: 297
Rep Power: 13
Default MODIFICATION: Receive a copy of the email sent from visitors to listing owners.

Ever wanted to monitor messages that are sent from the contact form through the listing pages? I do this myself to monitor spam send to listing owners. I also use these emails to count how many messages were sent from website visitors each month. This is how I monitor conversions.

You need the developer edition to do this modification.

Open contact.php. Its located yourdomain.com/contact.php

Find this:
Code:
$msg=$Mailer->sendMail($to, $content, $vars);
Add this right after it:
Code:
//now make a copy for the admin
$to="[email protected]";
$content="contactownercopy.tpl";
$msg=$Mailer->sendMail($to, $content, $vars);
Replacing your email with [email protected]

Notice that the email you receive will be the template "contactownercopy.tpl". You will need to upload this template to your email template folder.

You can use the template I made shown below. It is a slightly modified copy of contactowner.tpl

Code:
{assign var='subject' value='New message sent from your website'}
{include file="emails/html/mail_header.tpl"}
<h2>New Message</h2>
Hi Admin,
<p>The following message has been sent to the listing owner from a visitor on your website.</p>
<div class="hr"><hr /></div>
<strong>Name:</strong> {$name}<br />
<strong>Email:</strong> {$fromemail}<br />
<strong>Message:</strong><br />
{$comments}<br /><br />
<strong>Listing URL: </strong><a href="{$listing_url}">{$listing_url}</a>
<div class="hr"><hr /></div>
<br />
{include file="emails/html/mail_footer.tpl"}
__________________
Version 4.0.3 Developer

Last edited by cwp; 04-04-2008 at 10:24 AM.
Reply With Quote
  #2  
Old 04-25-2008, 11:36 AM
Junior Member
 
Join Date: Dec 2006
Location: Canada | China
Posts: 18
Rep Power: 8
Default

I've tried this on my site, but doesn't seem to forward the copy. Any other settings I have to touch-up on back-end maybe?
__________________
Arch / v4.0.1 Developer

HyeClassifieds Marketplace | ningboClassifieds Marketplace | ningboSites Directory | a613 Web Solutions
Reply With Quote
  #3  
Old 04-25-2008, 04:50 PM
cwp's Avatar
cwp cwp is offline
Senior Member
 
Join Date: Jun 2007
Posts: 297
Rep Power: 13
Default

Did you upload the new template? Without having a template you won't receive anything.
__________________
Version 4.0.3 Developer
Reply With Quote
  #4  
Old 05-19-2008, 01:36 AM
Senior Member
 
Join Date: Oct 2007
Location: victoria, Australia
Posts: 175
Rep Power: 7
Default

hi,
i need to implement this operation in 3.1 but i dont have "$msg=$Mailer->sendMail($to, $content, $vars);"
or part thereof in my contact.php.

can this be done in ver 3.1 dev?

thanks
Reply With Quote
  #5  
Old 05-19-2008, 11:06 PM
Junior Member
 
Join Date: Mar 2008
Posts: 9
Rep Power: 0
Default

Hi,
I was wondering is there any way to get the IP of the sender and then block the IP somehow if the messages were spam or scam?
Thanks
__________________
Developping 45ADs.com
Reply With Quote
  #6  
Old 05-20-2008, 01:56 AM
cwp's Avatar
cwp cwp is offline
Senior Member
 
Join Date: Jun 2007
Posts: 297
Rep Power: 13
Default

Quote:
Originally Posted by paulsra View Post
hi,
i need to implement this operation in 3.1 but i dont have "$msg=$Mailer->sendMail($to, $content, $vars);"
or part thereof in my contact.php.

can this be done in ver 3.1 dev?

thanks
In version 3 its all different code. Theres a way to do this in version 3.. Please thank Mike-N-Tosh for this:

I believe this is as simple as this. Open your "contact.php" file and around line 121 you should see this:
Code:
$mail = new Mailer();
$mail->AddAddress($to);
$mail->From = $from;
$mail->FromName = $name;
$mail->Subject = $subject;
$mail->IsHTML(true);
$mail->Body = $htmlContent;
$mail->AltBody = $textContent;
Just add a line to this like this:
Code:
$mail->AddBCC("email@yourdomain");
Obviously, changing the email address to the email address that you want it sent to. This won't send a different email to you, but a copy of the original email to you BCC so no one else see's it's being sent to you or the email address.

I do this same thing, but for the user registration (userjoin.php) so that we know when a new user signs up.
__________________
Version 4.0.3 Developer
Reply With Quote
  #7  
Old 05-20-2008, 01:58 AM
cwp's Avatar
cwp cwp is offline
Senior Member
 
Join Date: Jun 2007
Posts: 297
Rep Power: 13
Default

Quote:
Originally Posted by martso View Post
Hi,
I was wondering is there any way to get the IP of the sender and then block the IP somehow if the messages were spam or scam?
Thanks
Not sure, you'll have to hire someone to custom code this in for you.
__________________
Version 4.0.3 Developer
Reply With Quote
  #8  
Old 05-20-2008, 09:27 AM
Senior Member
 
Join Date: Oct 2007
Location: victoria, Australia
Posts: 175
Rep Power: 7
Default

Quote:
Originally Posted by cwp View Post
In version 3 its all different code. Theres a way to do this in version 3.. Please thank Mike-N-Tosh for this:

I believe this is as simple as this. Open your "contact.php" file and around line 121 you should see this:
Code:
$mail = new Mailer();
$mail->AddAddress($to);
$mail->From = $from;
$mail->FromName = $name;
$mail->Subject = $subject;
$mail->IsHTML(true);
$mail->Body = $htmlContent;
$mail->AltBody = $textContent;
Just add a line to this like this:
Code:
$mail->AddBCC("email@yourdomain");
Obviously, changing the email address to the email address that you want it sent to. This won't send a different email to you, but a copy of the original email to you BCC so no one else see's it's being sent to you or the email address.

I do this same thing, but for the user registration (userjoin.php) so that we know when a new user signs up.
thats perfect, thanks mike-n-tosh, and CWP.

userjoin sounds like a good ider as well, do you get both emails when someone joins up?
i tried it and it woks great!

thanks

Last edited by paulsra; 05-20-2008 at 09:51 AM.
Reply With Quote
  #9  
Old 05-20-2008, 02:13 PM
Member
 
Join Date: Dec 2007
Posts: 51
Rep Power: 5
Default

Hi,
I followed all of the instructions and this is the error that I got in my email box.

Warning: Smarty error: unable to read resource: "emails/html/modifylisting.tpl" in /var/www/vhosts/naturalhorseforsale.com/httpdocs/includes/classes/smarty/Smarty.class.php on line 1095

Anything I can do? I did create and upload the template as stated.

Thanks,
Jill B
Reply With Quote
  #10  
Old 05-21-2008, 11:56 PM
cwp's Avatar
cwp cwp is offline
Senior Member
 
Join Date: Jun 2007
Posts: 297
Rep Power: 13
Default

I'll look into this once I'm able to view my website (dns). It's possible this won't work with the newest version.
__________________
Version 4.0.3 Developer
Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Modification: Civs Similar Listings keeps visitors longer civ v3.1 Modules & Modifications 13 05-25-2008 08:17 PM
Modification: Civs Feedback for emailing users that delete a listing civ v3.1 Modules & Modifications 1 05-25-2008 08:16 PM
Modification: Site-Wide Listing Status Reminder for customers having unpaid listings civ v3.1 Modules & Modifications 21 10-18-2007 01:12 PM
Email notify users of new or modified listing abkeller v3.1 Modules & Modifications 9 07-03-2007 04:23 PM
Direct link to user listing in contact email SkGold v3.1 Questions & Support 2 07-10-2006 02:42 PM


All times are GMT -4. The time now is 06:42 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22