Notifications about profile,photo comments and profile,photo,blog rate

Hi, all. Here is the method to make email notifications about comments in owner's photos and profile (i haven't found where to make notification about comment in blog), and about rates of owner's profile, photos and blog.

 

1. import attached sql file in your sys_email_templates (now you can edit templates in admin panel)

2. in BxSpyProfilesActivity.php (/modules/boonex/spy/classes) (i think that spy module must be installed, but not sure) find: (line ~17) 

// define profile's nickname; 

and after it add:

$iRecipient   = getProfileInfo($iRecipientId);

then find:

case 'commentPost' :

and just before closing } of this case add:

$oEmailTemplate = new BxDolEmailTemplates();
                $aTemplate = $oEmailTemplate -> getTemplate('t_ProfileComment') ;
               
                sendMail($iRecipient['Email'], $aTemplate['Subject']
                    , $aTemplate['Body'], '', $aParams['params'] );

then find:

case 'rate' :

and just before closing } of this case add:

$oEmailTemplate = new BxDolEmailTemplates();
                $aTemplate = $oEmailTemplate -> getTemplate('t_ProfileRate') ;
               
                sendMail($iRecipient['Email'], $aTemplate['Subject']
                    , $aTemplate['Body'], '', $aParams['params'] );

 

3. in BxDolFilesModule.php (/inc/classes)

find: line ~1119

$aInfo = $this->_oDb->getFileInfo(array('fileId' => $iObjectId), true, array('medUri', 'medTitle', 'medProfId'));

and just after it place:

$iRecipient = getProfileInfo($aInfo['medProfId']);

then find:

 case 'commentPost' :

and just before break of this case add:

$oEmailTemplate = new BxDolEmailTemplates();
                $aTemplate = $oEmailTemplate -> getTemplate('t_PhotoComment') ;
               
                sendMail($iRecipient['Email'], $aTemplate['Subject']
                    , $aTemplate['Body'], '', $aRet['params'] );

then find:

case 'rate' :

and just before break of this case add:

$oEmailTemplate = new BxDolEmailTemplates();
                $aTemplate = $oEmailTemplate -> getTemplate('t_PhotoRate') ;
               
                sendMail($iRecipient['Email'], $aTemplate['Subject']
                    , $aTemplate['Body'], '', $aRet['params'] );

4. in BxBlogsModule (/modules/boonex/blogs/classes)

find: line~2854 (at the end)

 case 'rate' :
                $aPostInfo = $this->_oDb->getPostInfo($iObjectId);
                if($aPostInfo['OwnerID']) {

and just after { add:

$iRecipient = getProfileInfo($aPostInfo['OwnerID']);

and just before } (a bit lower) add:

$oEmailTemplate = new BxDolEmailTemplates();
                $aTemplate = $oEmailTemplate -> getTemplate('t_BlogRate') ;
               
                sendMail($iRecipient['Email'], $aTemplate['Subject']
                    , $aTemplate['Body'], '', $aRet['params'] );

 

My english is not so good, but i hope that you'll understand my explanation

sys_email_templates.sql · 2.9K · 41 downloads

Thanks! too useful.

 

Did you find the way to integrate it with blog comments?

Those this mod works  in 7.0.9?

i think this  is  a  great mod

:)