Topic: New topic/posts admin email notification

Hi,

Is it possible for the admin to receive an email for each new topic  or post?

Thanks,
Eric

Re: New topic/posts admin email notification

Looks like this isn't built in so I found this:
http://www.punres.org/desc.php?pid=95

Any ideas if this will be come included in 1.3?

Re: New topic/posts admin email notification

Most likely not, since this becomes too intensive for forums rather quickly (ie: if you have 100 posts per day, you'll be sent 100 emails)

Re: New topic/posts admin email notification

Smartys wrote:

Most likely not, since this becomes too intensive for forums rather quickly (ie: if you have 100 posts per day, you'll be sent 100 emails)

But on new boards with no moderators, it is quite useful.  Most forums take some time to get up to 100 a day. 

I tried this http://www.punres.org/desc.php?pid=95 but no luck. it was built for 1.2.5.

If anyone wants a quick and dirty way to do this, I added the following code in post.php at line 322 right before this line: 

        redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $lang_post['Post redirect']);
    }
}

Add this:

        /***************************
         *************************** SEND MAIL 
         ***************************/
         
         // get subject line
         if ($tid) {
             $custom_subject = 'New Post - ' . stripslashes($cur_posting['subject']);
         } else if ($fid) {
              $custom_subject = 'New Post - ' . stripslashes($db->escape($subject));
         }
         
         
         if ($pun_user['id'] != 2) { // or whatever the admin's ID is
            $custom_to      = 'email@domain.com';
            $custom_message = 'New post/thread: http://www.YOURDOMAIN.com/forums/viewtopic.php?pid='.$new_pid.'#p'.$new_pid;
            $custom_headers = 'From: YOUR Forums <youremail@domain.com>' . "\r\n" .
               'Reply-To: whatever@domain.com' . "\r\n" .
               'X-Mailer: PHP/' . phpversion();

            mail($custom_to, $custom_subject, $custom_message, $custom_headers);
         }         
        /***************************
         ***************************
         ***************************/

This sends an email after any post has been made or a thread started to the admin.  Like i said, very dirty coding but it's fine for those just getting their sites off the ground and don't have an active community of "post reporters" to identify nefarious posts.

This little hack is for 1.2.14

Eric

5

Re: New topic/posts admin email notification

The above codeworking for you?

My thread :
http://punbb.org/forums/viewtopic.php?id=14826
That mod not sending email.

thanks.

Re: New topic/posts admin email notification

I'd make sure that everything within this IF conditional is correct:

if ($pun_user['id'] != 2) { // or whatever the admin's ID is
            $custom_to      = 'email@domain.com';
            $custom_message = 'New post/thread: http://www.YOURDOMAIN.com/forums/viewtopic.php?pid='.$new_pid.'#p'.$new_pid;
            $custom_headers = 'From: YOUR Forums <youremail@domain.com>' . "\r\n" .
               'Reply-To: whatever@domain.com' . "\r\n" .
               'X-Mailer: PHP/' . phpversion();

            mail($custom_to, $custom_subject, $custom_message, $custom_headers);
         }

7

Re: New topic/posts admin email notification

Thanks. Its working.

But anybody using 'Mail posts' mod with success?

8

Re: New topic/posts admin email notification

Oreamnos wrote:

I tried this http://www.punres.org/desc.php?pid=95 but no luck. it was built for 1.2.5.

http://www.punres.org/viewtopic.php?id=229
You have to change the version.

May be yu can fix the mod smile

Re: New topic/posts admin email notification

rrts wrote:

Thanks. Its working.

But anybody using 'Mail posts' mod with success?

unfortunately it looks like Mail Posts was developed for 1.2.5 and hasn't been changed since... sad

10 (edited by rrts 2007-03-16 02:39)

Re: New topic/posts admin email notification

http://www.punres.org/viewtopic.php?id=229
You have to change the version for installation.

May be you can fix the mod.

Re: New topic/posts admin email notification

rrts wrote:

http://www.punres.org/viewtopic.php?id=229
You have to change the version for installation.

May be you can fix the mod.

wow, that looks easy.  just open the file and change the necessary lines contained within the first 12 lines.  i haven't tried it but i might try it later...

12 (edited by rrts 2007-03-16 12:01)

Re: New topic/posts admin email notification

OK. If that 'Mail posts' mod working for you, can you please let me know?

You don't have to change all 12 lines in install_mod.php. just line 12 I think?

Thanks.

13 (edited by StewartAtmail 2009-01-12 00:14)

Re: New topic/posts admin email notification

Oreamnos wrote:

If anyone wants a quick and dirty way to do this, I added the following code in post.php at line 322 right before this line: 

        redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $lang_post['Post redirect']);
    }
}

I do not see this line of code at all within my post.php file.

14

Re: New topic/posts admin email notification

StewartAtmail wrote:
redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $lang_post['Post redirect']);
    }
}

I do not see this line of code at all within my post.php file.

1.3* is not 1.2*.