Support Forums

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 Modules / Plugins / Modifications forums, part of the Developer Forums 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 > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 04-04-2008, 11:05 AM   #1
Senior Member
 
cwp's Avatar
 
Join Date: Jun 2007
Posts: 296
Rep Power: 26
cwp is a jewel in the rough
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="youremail@emailaddress.com";
$content="contactownercopy.tpl";
$msg=$Mailer->sendMail($to, $content, $vars);
Replacing your email with youremail@emailaddress.com

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 11:24 AM.
cwp is offline   Reply With Quote
Old 04-25-2008, 12:36 PM   #2
Junior Member
 
Join Date: Dec 2006
Location: Canada | China
Posts: 18
Rep Power: 21
archavir is on a distinguished road
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
archavir is offline   Reply With Quote
Old 04-25-2008, 05:50 PM   #3
Senior Member
 
cwp's Avatar
 
Join Date: Jun 2007
Posts: 296
Rep Power: 26
cwp is a jewel in the rough
Default

Did you upload the new template? Without having a template you won't receive anything.
__________________
Version 4.0.3 Developer
cwp is offline   Reply With Quote
Old 05-19-2008, 02:36 AM   #4
Senior Member
 
Join Date: Oct 2007
Location: victoria, Australia
Posts: 176
Rep Power: 21
paulsra is on a distinguished road
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
paulsra is offline   Reply With Quote
Old 05-20-2008, 12:06 AM   #5
Junior Member
 
Join Date: Mar 2008
Posts: 9
Rep Power: 0
martso is on a distinguished road
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
martso is offline   Reply With Quote
Old 05-20-2008, 02:56 AM   #6
Senior Member
 
cwp's Avatar
 
Join Date: Jun 2007
Posts: 296
Rep Power: 26
cwp is a jewel in the rough
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
cwp is offline   Reply With Quote
Old 05-20-2008, 02:58 AM   #7
Senior Member
 
cwp's Avatar
 
Join Date: Jun 2007
Posts: 296
Rep Power: 26
cwp is a jewel in the rough
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
cwp is offline   Reply With Quote
Old 05-20-2008, 10:27 AM   #8
Senior Member
 
Join Date: Oct 2007
Location: victoria, Australia
Posts: 176
Rep Power: 21
paulsra is on a distinguished road
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 10:51 AM.
paulsra is offline   Reply With Quote
Old 05-20-2008, 03:13 PM   #9
Member
 
Join Date: Dec 2007
Posts: 51
Rep Power: 18
goin4savvy is on a distinguished road
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
goin4savvy is offline   Reply With Quote
Old 05-22-2008, 12:56 AM   #10
Senior Member
 
cwp's Avatar
 
Join Date: Jun 2007
Posts: 296
Rep Power: 26
cwp is a jewel in the rough
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
cwp is offline   Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 05:12 AM.


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