Joomla! Discussion Forums



It is currently Sun Nov 08, 2009 9:30 am (All times are UTC )

 


Forum rules

Please submit all new Tips and Tricks to: http://docs.joomla.org/Category:Tips_and_tricks

This forum section will be closed and removed eventually.



Post new topic Reply to topic  [ 11 posts ] 
Author Message
Posted: Thu Oct 06, 2005 5:42 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Mon Aug 22, 2005 5:43 pm
Posts: 758
Location: Minneapolis, MN
Have you ever wanted to know more than just that a new private message has arrived when your users submit items?  How about, what they submitted and a quick link back to your administration panel?

OK, here's what to do.

In your language file (for example, if using english, your /language/english.php file), change your _ON_NEW_CONTENT line to this (customize it how you like):

Code:
DEFINE('_ON_NEW_CONTENT', "Hello,\nA new content item has been submitted by [ %s ] titled [ %s ] for the section [ %s ] and category [ %s ].\nPlease go to $mosConfig_live_site/administrator/ to view and approve this article.\nPlease do not respond to this message as it is automatically generated and is for information purposes only." );


Then go in to /components/com_messages/messages.class.php, and delete these two lines (should be 84 and 85):

Code:
$subject = _NEW_MESSAGE;
$msg = _NEW_MESSAGE;


Then, in the next line (formerly 87), change $msg to $message, like so:
Code:
mosMail($mosConfig_mailfrom, $mosConfig_fromname, $recipient, $subject, $message);

This will make it email using the same subject and message line that is in the private message.

[edit - included reference to the language file]

_________________
http://www.technoadvice.com


Last edited by chadness on Wed Jul 12, 2006 7:19 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Wed Jul 12, 2006 5:41 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Jul 12, 2006 5:37 pm
Posts: 258
Location: London, UK
Quote:
OK, here's what to do. Try changing your _ON_NEW_CONTENT line to this (customize it how you like):


in which file though? I've tried changing things in the following files:

/components/com_content/content.php
/components/com_messages/messages.class.php

neither seem to work, wherever I add in that code or wherever I modify something. I have now got the emails more useful, and showing the contents of the actual private message, but nothing works to include your polite message. I think you have simply ommitted to inform us which file we should add that code to!

Thanks in advance for your assistance...


Top
  E-mail  
 
Posted: Wed Jul 12, 2006 5:53 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Mon Aug 22, 2005 5:43 pm
Posts: 758
Location: Minneapolis, MN
Good point - I didn't make that very clear.  _ON_NEW_CONTENT is one of the variables in your language file.  So, if you are using english, you would change it in /language/english.php .

_________________
http://www.technoadvice.com


Top
  E-mail  
 
Posted: Wed Jul 12, 2006 7:03 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Jul 12, 2006 5:37 pm
Posts: 258
Location: London, UK
AWESOME! thanks for the speedy response too... once I managed to undo all the changes I'd done it worked a treat!

Cheers, and keep up the great work.

Mods/Admins feel free to clean up this thread now to include reference to the language file in the original post...


Top
  E-mail  
 
Posted: Wed Jul 12, 2006 7:19 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Mon Aug 22, 2005 5:43 pm
Posts: 758
Location: Minneapolis, MN
jackbremer wrote:
AWESOME! thanks for the speedy response too... once I managed to undo all the changes I'd done it worked a treat!

Cheers, and keep up the great work.

Mods/Admins feel free to clean up this thread now to include reference to the language file in the original post...


Done.  I'll leave the comments in case anyone else was wondering where that was.

_________________
http://www.technoadvice.com


Top
  E-mail  
 
Posted: Fri Jul 14, 2006 7:53 am 
Joomla! Intern
Joomla! Intern
Offline

Joined: Tue Oct 04, 2005 2:12 am
Posts: 87
Very cool. Actually the first part in language file was already in there. Changing the class made it work.
Now, can that email be linked to the content?


Top
  E-mail  
 
Posted: Fri Jul 14, 2006 8:51 am 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Jul 12, 2006 5:37 pm
Posts: 258
Location: London, UK
Indeed Lionel, it was in there originally, and this simply makes it more polite and provides a link direct to the administration panel.

I suppose if we knew what the content's variable name was we could include that too? I don't quite understand how it knows which bit refers to which when they are listed simply as $s for each variable in the language file... any ideas?


Top
  E-mail  
 
Posted: Mon Jul 24, 2006 3:32 pm 
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Tue Sep 06, 2005 10:53 pm
Posts: 118
Doea anyone know whether this will make it into J! 1.5 or whether there is a module/component about to handle this???

Such basic functionality - its astounding...

If not - I'll try the hack for now.


Top
  E-mail  
 
Posted: Mon Jul 24, 2006 3:35 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Thu Aug 18, 2005 1:27 pm
Posts: 544
Location: Washington, DC
Ottobufonto,

I don't believe this will be included in 1.5, but if you can come up with a good modeled hack, I'm sure we can persuade the core to include the functionality into 1.6, etc.

Best,
Ryan

_________________
PICnet - "Empowering the missions of non-profits through technology"
www.picnet.net


Top
   
 
Posted: Mon Jul 24, 2006 3:45 pm 
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Tue Sep 06, 2005 10:53 pm
Posts: 118
I didn't mean I would write a hack... well I can try - but J! 2.0 might be out before that... :-)

I have seen the "email me on new message", but I think this should be a configurable system where you can select receipients from publisher list against differnt sections of the page... instead of admin..

When I said basic - I didn't mean simple. just something that a cms should do.... user a) submits content to b) or c) or d) and based on set of rules differnt publishers get notified to approve content.... implementation is probably for from trivial.

Otto


Top
  E-mail  
 
Posted: Mon Jul 07, 2008 12:10 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Tue Nov 14, 2006 1:32 am
Posts: 4
This didn't quite work for me. Here's what I had to do to make it work (using 1.0.15):

Changed the language file (/language/english.php) as you instructed:

Code:
DEFINE('_ON_NEW_CONTENT', "Hello,\nA new content item has been submitted by [ %s ] titled [ %s ] for the section [ %s ] and category [ %s ].\nPlease go to $mosConfig_live_site/administrator/ to view and approve this article.\nPlease do not respond to this message as it is automatically generated and is for information purposes only." );


Editing /components/com_messages/messages.class.php didn't seem to work for me, so I left it alone. Instead I added the following to /component/com_content/content.php around line 2400 right after:

foreach ($users as $user_id) {
$msg = new mosMessage( $database );
$msg->send( $my->id, $user_id, "New Item", sprintf( _ON_NEW_CONTENT, $my->username, $row->title, $section, $category ) );
}

Add:

Code:
mosMail( "noreply@yourdomain.com", "Admin", "noreply@yourdomain.com", "New Item", sprintf( _ON_NEW_CONTENT, $my->username, $row->title, $section, $category ) );


Works like a charm - curious for you opinion on this! Personally I hate hacks, they make life difficult. However, my client needed a better way of controlling workflow. They have rules set on the email client that receives this email. It checks the section and category then forwards it to the correct publisher for that section. I have my fingers crossed that the next version of Joomla will have this capability built in!

_________________
"Getting information off the Internet is like taking a drink from a fire hydrant!"

- Dustin
http://www.dustinsdesign.com


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group