News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

announcement topic email notifcation

Started by joesmoh, July 15, 2009, 04:12:00 PM

Previous topic - Next topic

joesmoh

sorry if this is in the wrong section - Im a NOOB

I know user can set the e-mail notification of boards.  I the admin would like to set my announcement board topic to be e-mail to all members.  Is there an admin setting where I can do this.

i.e.
Board is called SoCal Events

so every time a topic is posted in the board called SoCal Events I would like an e-mail sent to every member.

N3RVE

What is your specific version of SMF?

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

joesmoh

sorry got a little busy and forgot to check this forum.  I guess I am using Powered by SMF 1.1.9 it was on the bottom of my forum.

N3RVE

Okay, let's see. I hope I understood you correctly.
You have an announcement board where you often post announcement and you'd like an E-mail dispatched to your members when a new topic is created in that board. If that's correct, the following code changes should be sufficient. However, take note that the user would have to open that board. The code will check if notify is enabled or not for a particular board when the member enters it. If notification is not set, it enables it automatically for that member.

Code (Find) Select
// View all the topics, or just a few?

Code (Add before) Select

   if ($board == 1 && !$user_info['is_guest'])
   {
      $request = db_query("
         SELECT ID_MEMBER
         FROM {$db_prefix}log_notify
         WHERE ID_MEMBER = $ID_MEMBER
            AND ID_BOARD = $board
         LIMIT 1", __FILE__, __LINE__);
      $already_set = mysql_num_rows($request) != 0;
      mysql_free_result($request);

      if (!$already_set)
         db_query("
         INSERT IGNORE INTO {$db_prefix}log_notify
            (ID_MEMBER, ID_BOARD)
         VALUES ($ID_MEMBER, $board)", __FILE__, __LINE__);
   }


Replace "1" with the Board ID :).

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

joesmoh

Quote from: [n3rve] on July 18, 2009, 04:21:18 PM
Okay, let's see. I hope I understood you correctly.
You have an announcement board where you often post announcement and you'd like an E-mail dispatched to your members when a new topic is created in that board.


n3rve, thanks again, yes this is correct, it is expo with dates that the member need to know before it is over

QuoteIf that's correct, the following code changes should be sufficient. However, take note that the user would have to open that board. The code will check if notify is enabled or not for a particular board when the member enters it. If notification is not set, it enables it automatically for that member.


I have trouble looking for which php file i put this code into.  I have look in these files and found nothing starting with View all the topics, or just a few? in the comment section of this php files could you tell me the exact file.  Since I am using the default because I do not know how to change it yet (another topic).  I looked in theme/default.
1. index.templete.php
2. memberlist.templete.php
3. theme.templete.php

Another question on your reply.  Member has to enter the board.  Does this mean they do not get an e-mail notification?  Does this mean after they start the forum the e-mail will be sent?  Does this mean when they login the forum it will set their account to receive e-mail from now on?

Thanks again for your help............


N3RVE

QuoteI have trouble looking for which php file i put this code into.  I have look in these files and found nothing starting with View all the topics, or just a few? in the comment section of this php files could you tell me the exact file.

My bad, I should have posted the file location/name, sorry :).
Sources/MessageIndex.php

QuoteAnother question on your reply.  Member has to enter the board.  Does this mean they do not get an e-mail notification?  Does this mean after they start the forum the e-mail will be sent?  Does this mean when they login the forum it will set their account to receive e-mail from now on?

No, that means after you make the above code changes. Only the members that enter the announcement boards (by 'enter', I mean open the board) will receive the E-mails. The code above will check if they have "notify" enabled for a particular board defined with the php code above and if they don't, it will automatically enable it :).

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

joesmoh

Thanks Once again, I am just starting so many thanks to my question till I learn SMF and PHP, K this one done, Thank You

N3RVE

Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

dvdcloner4

Hi, guys...

I am also a Noob here in SMF. looking forward exchanging great resource of info with you.

Cheers!
Chris
hxxp:www.dvdcloner.com [nonactive]

doidom

For Start A New Topic, is there a way to have Additional Options always expanded or opened. I'd like Member to see and use Announce Topic when needed and I think it would help to have Options expanded and Announce Topic in red.

Advertisement: