mail: "there is a new comment in your story"

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-13-2007, 02:31 AM
New Pligger
 
Join Date: Sep 2006
Posts: 24
go to story.php, line 30 and change this:

Code:
	if(isset($_POST['process'])){
		if ($_POST['process']=='newcomment') {
			insert_comment();
		}
	}
Code:
	if(isset($_POST['process'])){
		if ($_POST['process']=='newcomment') {
			$authormail = $db->get_var("SELECT user_email FROM users WHERE `user_id` = '$link->author';");
			mail($authormail,"there is a new comment in your story","hello, bodytext!");
			insert_comment();
		}
	}
so, every time some one write a comment in a story, the system will send the story author an email.
Reply With Quote
  #2 (permalink)  
Old 03-13-2007, 04:23 AM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 3,803
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
This would be really cool if you built in an option for the author to check a box when submitting the story to subscribe to his article's comments. Good idea.

Now Available: Facebook Connect Module !
Reply With Quote
  #3 (permalink)  
Old 03-13-2007, 12:50 PM
New Pligger
 
Join Date: Sep 2006
Posts: 24
you can do that with the "extra fields"
Reply With Quote
  #4 (permalink)  
Old 03-13-2007, 01:00 PM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
The bad thing with this is that some people might not want to get emails so there has to be a config option in their profile or something so ppl can turn this off.

Last edited by kbeeveer46; 03-13-2007 at 01:31 PM.
Reply With Quote
  #5 (permalink)  
Old 03-13-2007, 10:00 PM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,961
Option for turning it off would be really good idea.
Reply With Quote
  #6 (permalink)  
Old 03-27-2007, 03:50 PM
Casual Pligger
 
Join Date: Jul 2006
Posts: 60
perhaps rewritten as a module so that an admin can simply enable and then it will add the field using the other mod that allows mods to add extra fields?
Reply With Quote
  #7 (permalink)  
Old 09-14-2007, 08:49 PM
Casual Pligger
 
Join Date: May 2007
Posts: 83
Anyone implement something like this as a module, or with the ability to turn this feature on and off per user?

I really would love this, but Im not much of a developer.

Thanks in advance

JB
Reply With Quote
  #8 (permalink)  
Old 09-15-2007, 01:42 AM
davemackey's Avatar
Pligg Donor
Pligg Version: 9.9.
Pligg Template: siChunkBlue
 
Join Date: Aug 2007
Location: Langhorne, PA
Posts: 226
Would be great to see this feature integrated into the main codebase.
Reply With Quote
  #9 (permalink)  
Old 09-15-2007, 03:32 AM
nzbullet's Avatar
Constant Pligger/Coder
 
Join Date: Jun 2007
Location: New Zealand
Posts: 115
Yankidank, A way to do this, not quite a check box, would be as follows:

1.For the code above, use this code instead If you are looking to change the send announcement module ONLY then skip this step:

Code:
if(isset($_POST['process'])){
		if ($_POST['process']=='newcomment') {
			$authormail = $db->get_var("SELECT public_email FROM users WHERE `user_id` = '$link->author';");
			mail($authormail,"there is a new comment in your story","hello, bodytext!");
			insert_comment();
		}
	}
2.Then you need to go to "templates/yget/user_center.tpl" and remove this code from around line 289:

Code:
{if $user_publicemail ne ""}

				<tr>

				<td><strong>{#PLIGG_Visual_User_Profile_PublicEmail#}:</strong></td>

				<td>{$user_publicemail}</td>

				</tr>

				{/if}
This will remove the users public email from the users profile so others cannot see it.

3.Next go to Pligg Beta 9 Home » Admin » Modify Language and filter for "public email" Change this to something like "Email Communication"

4.The last step is Optional, but I recommend you add something here. I have shown below what I added due to the new legal requirements but you could change this to anything you want. Go to "templates/yget/profile_center.tpl" and do the following:

between:
Code:
<br />
Code:
<input type="submit" name="save_profile" value="{#PLIGG_Visual_Profile_Save#}" class="log2" tabindex="16"></p>
add:

Code:
<fieldset><legend>email communication:</legend>

		

<center>As you may know, from September 5th 2007 the Unsolicited Electronic
Messages Act 2007 will regulate the kinds of messages you can be sent by
email or text.
To allow Linka New Zealand Limited to send you occasional emails be sure to fill out the "Email Communication" field on your profile page.
We don't email you all that often but every now and then we may have something important to let you know about. 
By filling out this field you are consenting to Linka New Zealand Limited communicating with you by email. If you do NOT want to receive communications from us please leave this field blank. You can stop receiving emails from Linka New Zealand Limited at anytime by removing your email address from the "Email Communication" field.
</center>
</fieldset>		

<br/>

<br/>
this should then look like this

Code:
<br />

<fieldset><legend>email communication:</legend>

		

<center>As you may know, from September 5th this year the Unsolicited Electronic
Messages Act 2007 will regulate the kinds of messages you can be sent by
email or text.
To allow Linka New Zealand Limited to send you occasional emails be sure to fill out the "Email Communication" field on your profile page.
We don't email you all that often but every now and then we may have something important to let you know about. 
By filling out this field you are consenting to Linka New Zealand Limited communicating with you by email. If you do NOT want to receive communications from us please leave this field blank. You can stop receiving emails from Linka New Zealand Limited at anytime by removing your email address from the "Email Communication" field.
</center>
</fieldset>		

<br/>

<br/>

<input type="submit" name="save_profile" value="{#PLIGG_Visual_Profile_Save#}" class="log2" tabindex="16"></p>

I changed the way the site announcement works so that people could either subscribe to site wide emails or not. It is up to them. It is not auto switched on which is a pain, but.....it does mean that they can opt in if they want to. then when you send an announcement only those people will receive it. I did this due to a law change in NZ which requires the user to agree to receiving emails. It is the only way I could implement it.

To do this once you have completed above go to
"/modules/send_announcement/templates/sendannouncement.tpl"

search for "user_email" and change to "public_email"

Last edited by nzbullet; 09-15-2007 at 05:53 PM.
Reply With Quote
  #10 (permalink)  
Old 09-19-2007, 01:50 PM
Casual Pligger
 
Join Date: May 2007
Posts: 83
I'd like to simply see the ability to subscribe (and maybe unsubscribe) to a particular post/article, and receive email notifications when comments are posted.

Anyone have a way to add this?
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail not working from local system mrigank Questions and Comments 3 02-23-2009 02:06 AM
Special character problems in RSS and mail subject ditto Questions and Comments 8 04-22-2008 04:28 PM
Editing a reply to a comment? bbrian017 Questions and Comments 0 01-10-2008 04:30 PM
A proposal for a more robust way of comment deletion. sefs Questions and Comments 0 10-12-2007 04:30 PM
Comment Count Update Simon Questions and Comments 4 06-01-2007 09:45 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development