send email after a new category created by users (frontend)

Phoca Gallery - image gallery extension
gerilla
Phoca Member
Phoca Member
Posts: 33
Joined: 04 Nov 2008, 17:16

send email after a new category created by users (frontend)

Post by gerilla »

hi, its me again :)
i saw this request at wishlist, too, so i made a modification for email sending after a new category added by a user. i am new in php indeed, so if you see any any mistake or absence in the code just write here...

open components/com_phocagallery/views/user/tmpl/default_category.php file:

find this:

Code: Select all

defined('_JEXEC') or die('Restricted access');
and add this under:

Code: Select all

global $mainframe;
$uri 		= &JFactory::getURI();
$fromname	= $mainframe->getCfg( 'sitename' );
$mailfrom 	= $mainframe->getCfg( 'mailfrom' );
$subject = 'A new Gallery Added';
$message="<p>A new category has been added in Phoca Gallery.</p><p>Visit Your Gallery to see new category...</p>";
$message .= '<p><a href="' . JURI::base(). '/index.php?option=com_phocagallery&view=categories">Gallery Categories</a></p>';
and then find this code:

Code: Select all

.'<p>'.JText::_('Your category is unpublished').'</p></div>';
and add this below:

Code: Select all

JUtility::sendMail($mailfrom, $fromname, $mailfrom, $subject, $message, "1", "", "", "", "", "");
thats all.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49279
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: send email after a new category created by users (frontend)

Post by Jan »

Great, thank you for this guide....

Jan
If you find Phoca extensions useful, please support the project
Post Reply