68 Classifieds Forums
Go Back   68 Classifieds Forums > v3.0.x Help & Support > v3.0 Modifications > Email Admin When Listings Change
 
Thread Tools Search this Thread Display Modes
(#1)
DVM DVM is offline
Junior Member
DVM is on a distinguished road
 
Posts: 10
Join Date: Mar 2006
Default Email Admin When Listings Change - 10-10-2006, 07:31 PM

I would like to know if it's possible to email the Admin when the listing was changed.

Reason:
I need to know when the user makes a change to one of the Extra fields
let say " fID=16 " for example. If this is option drop down menu is changed when user modifies listing, I would like to be Emailed this change.

Is this possible? Or something similar?
(#2)
suzkaw suzkaw is offline
Staff
suzkaw is on a distinguished road
 
Posts: 1,232
Join Date: Mar 2006
Location: Belmont, NC
Default 10-11-2006, 10:14 AM

I don't believe this is possible however you could change the setting to change the listing status when they modify a listing which would allow you to double check the ad and make sure it is correct.


--
Thanks,
Eric Barnes
68 Classifieds

Documentation - Bug Reports - Modifications - My Blog
(#3)
juven14's Avatar
juven14 juven14 is offline
Moderator
juven14 is on a distinguished road
 
Posts: 1,305
Join Date: Mar 2006
Location: NJ/NYC Area
Default 10-11-2006, 11:04 AM

You could do this with a module, there are already hooks in place when the listing is modified.

You'd just need to add in to that hooks function to email if this field is changed. On the template you'd need a new hidden field to record the inital value and then compare that field's input against it, if it is different send email otherwise do nothing.

Edit: Sorry, I didn't see that this was in the 3.0 forum, my above statement only applies to 3.1 versions.


Regards,

John
mods.auscity.com
v3.1.4 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
(#4)
suzkaw suzkaw is offline
Staff
suzkaw is on a distinguished road
 
Posts: 1,232
Join Date: Mar 2006
Location: Belmont, NC
Default 10-11-2006, 11:16 AM

I didn't relize that either. But I think what I described will work with v3.0


--
Thanks,
Eric Barnes
68 Classifieds

Documentation - Bug Reports - Modifications - My Blog
(#5)
DVM DVM is offline
Junior Member
DVM is on a distinguished road
 
Posts: 10
Join Date: Mar 2006
Default Modify Email - 10-11-2006, 02:18 PM

I knew I could set it up that when the listing is changed I could have the program set to Admin approval. Which would work, but I didn't want to disrupt the ads from being online.

I know in thanks.php it setups and mails the admin when the listing is made.
Is there a way to have this code implimented in usermodifylisting.php?

PHP Code:
//now display the template
    
if($continue == true)
    {
        
//should mail the admin?
        
if($emailnotify != "N")
        {
            
$sSQL="SELECT checkoutNotification FROM ".PREFIX."checkout_settings WHERE checkoutID=1";
            
$result=$db->query($sSQL);
            
$rs=$result->fetch();
            if(
$rs['checkoutNotification']=="Y")
            {
                
//get the mail template
                
$sSQL="SELECT eID, eName, eSubject, eHTML, eText FROM ".PREFIX."email_templates WHERE eID=6";
                    
$result=$db->query($sSQL);
                    
$rs=$result->fetch();
                    
$subject=$rs['eSubject'];
                    
$htmlContent=$rs['eHTML'];
                    
$textContent=$rs['eText'];
                    
$sSQL="SELECT title,price FROM ".PREFIX."products WHERE id=".$lid;
                    
$result=$db->query($sSQL);
                    
$rs=$result->fetch();
                    
$emailmessage.= $htmlContent.'<br>'. LANG_TITLE.": ".safeStripSlashes($rs['title'])."<br>\n";
                    
$emailmessage.= LANG_PRICE .": ".FormatCurrency($rs['price'])."<br>\n";
                    
$emailmessage.= "<a href='".URL."/viewlisting.php?view=".$lid."'>".URL."/viewlisting.php?view=".$lid."</a><br>\n";
                    
$emailmessage.= "<a href='".URL."/administration/listinginfo.php?view=".trim($lid)."'>".URL."/administration/listinginfo.php?view=".trim($lid)."</a>";
                
// Instantiate mail class
                
$mail = new PHPMailer();
                
$mail->From     = ADMIN_EMAIL;
                
$mail->FromName = 'Admin';
                
$mail->Mailer   = "mail";
                
$mail->IsHTML(true);
                
$mail->Subject = $subject;
                
$mail->Body    = $emailmessage;
                
$mail->AltBody = strip_tags($emailmessage);
                
$mail->AddAddress(ADMIN_EMAIL);
                    if(!
$mail->Send())
                    {
                        
$class_tpl->assign('title',LANG_ERROR);
                        
$class_tpl->assign('pPageContent',LANG_ERROR_MAIL .' '. $mail->ErrorInfo);
                        
$class_tpl->assign('body','content.tpl.php');
                    }
            }
        }


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2006, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com