News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Notify admins when a new members joins, not working?

Started by Ian GSD, February 03, 2016, 04:25:21 PM

Previous topic - Next topic

Ian GSD

Quote from: Sir Osis of Liver on July 05, 2011, 11:44:51 PM
/
If you hardcode your email address in /Sources/Subs-Post.php as shown, you should receive the emails.  It's a workaround - only one admin will get the notifications.  If it doesn't work, there's something else to try in the same function.

I'm having the same problem: all forum mail routines seem to be working except New Member notification to admins.  SMF 2.0.11, all files up to date according to maintenance, all DBs optimized, hard-coded my email address into /Sources/Subs-Post.php  but still don't get the admin notice.  What's the 'something else' you mentioned?

It's not in any spam traps and the host (media temple) says:

QuoteThere doesn't appear to be anything for [email protected] in the last 48 hours, and I uploaded a test PHP script to your site which sent a message to a test Gmail address without issue. It seems like the application you're using is not actually attempting to send out these messages. We are not completely familiar with this application and would unfortunately be unable to advise as to why it is not sending your messages.

I have not tried changing the subject because I haven't figured out where that is yet.

BTW, last notification received (yes, it was working for years) was 9/27/15.

This has been driving me nuts.

Steve

Ian, it's preferred that you start your own topic as this thread is 4 and a half years old and solved. :)
DO NOT pm me for support!

margarett

I have a different idea. We'll add the information to your error log, so that we can track what happened.

Find in Sources/Subs-Post.php:
// And do the actual sending...
sendmail($row['email_address'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);
}
$smcFunc['db_free_result']($request);

Add after:
log_error('A member has registered: ' . $member_name . '. ' . count($groups) . ' users are set to receive email notification');
This should add an entry to your error log every time a member registers *and* will let us know how many users is SMF trying to email with such information.

Try to create a test user and then login with your admin account to check your error log. Let us know the outcome ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Ian GSD

First, thanks to whoever moved this to a new topic.

margarett, Thank you for the help.  I made your changes and added a user.  Here's the error report form the forum.  Is there some way to look at the log itself or doesn't that tell you any more than the SMF report ( at /forum/index.php?action=admin;area=logs;sa=errorlog;desc)?



Of course, the user email showed up but the admin notification has not.

Illori

assuming you are 1 user that should have received the email, do you receive any email from your forum?

margarett

Ok you can delete the test user. It seems that the email should really go. Let me get to the computer for further debug. The code I suggested did its work as supposed ;)

I assume you're the only admin?

Edit: ninja'd
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Ian GSD

Illori, yesI am the only admin.  I was about to say that I get other notifications but those are coming to my personal email.  New user notifications are gong to the webmaster address, [email protected] (a gmail address), which forwards to me.

I'm going to change the webmaster address to my personal address and try adding another test user.

margarett, I'll let you know how that turns out.

Ian GSD

On further reflection, these should be going to the personal address in my forum profile, as I have Administrator as my primary group. N'est-ce pas?

FWIW, changing the webmaster address did not produce any different result.

margarett

I don't understand your mail setup, please bear with me will 'ya? ;)

I was about to say that I get other notifications but those are coming to my personal email.  New user notifications are gong to the webmaster address
How? If you choose to send a notification to admins when a new member joins (index.php?action=admin;area=regcenter;sa=settings) the following happens:
- SMF picks the email addresses from the members allowed to "moderate_forum"
- checks if these users have chosen to be notified of that stuff. If not, remove them from the "destination" list
- sends the notification email to each of them

So, you will receive any notification on the email associated to your account!

Also, ALL emails are sent *from* whatever address SMF has configured as "Webmaster Email Address"
index.php?action=admin;area=serversettings;sa=general

As far as I see it, there are only 2 emails associated to this process. Eg:
Your domain, eg: domain.com
Your "webmaster email address", from which ALL emails are sent by SMF, eg: [email protected]
Your user's email address, which might be (or not) the same as webmaster email address.

Or how do you have it set up?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Ian GSD

The webmaster address is [email protected].  (We do use the [email protected] setting in index.php?action=admin;area=modsettings.) The user address for me, as admin, is [email protected].

I get notifications of "report to moderator" on boards I moderate, "new post" when my posts have been replied to, "new message" when I get a new message, etc.  The only thing I'm not getting is "a new member has joined".

I have attached a couple of screen shots of the areas you mentioned; 'send a notification to admins when a new member joins' and 'server settings', just so there's no confusion. Might as well add the 'email settings' and 'noreply'.

I realize that the webmaster address should not be getting the "a new member has joined" emails but I wold like to make sure that it does get emails from the site.  Is there anyplace on the forum with a "contact webmaster" link? Any other way to mail the webmaster address from the forum?


margarett

I'm not familiar with that MOD. Could you please disable (or uninstall) it and try again? I would also advise you to enable the mail queue. Set it to 5/2
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Ian GSD


Ian GSD

OK, dumb question, I found it.  No Reply Emails - 1.3.8 (FWIW, this MOD was installed long before this problem arose.)

I got the attached error message when I tried to uninstall.  Should I proceed.  I'm wondering if it's failing because I have messed around with Subs-Post.php in the course of trying various suggestions from this forum. Maybe the system is trying to validate a file that I have touched and failing for that reason.

I'm tempted to replace the Subs-Post.php on the server with a clean copy from the install (is that even possible?) and try the uninstall again.

What do you suggest?

margarett

No, don't do that!

Please attach your Subs-Post.php
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Ian GSD

Here are the errors I'm getting (just figured out what that little pen & paper icon was for)

Error 1
Replace:
// Hmm.. Do we want to Do No Reply Mail?
if(isset($modSettings['enableNoReply']) && $modSettings['enableNoReply'] == 1)
{
// Prevent a bad webmaster email links.
if(empty($webmaster_replyemail))
$webmaster_replyemail = $webmaster_email;

// Hmm.. if they didn't set a NoReplyEmail lets make one up from [email protected]
$webmaster_email = (isset($modSettings['NoReplyEmail']) && !empty($modSettings['NoReplyEmail']) ? $modSettings['NoReplyEmail'] : 'noreply@' . str_replace('www.', '', $_SERVER['HTTP_HOST']));
        @ini_set('sendmail_from', $webmaster_email);

// Setup the message and end this.
$message .= $line_break . (isset($modSettings['NoReplyMessage']) && !empty($modSettings['NoReplyMessage']) ? $modSettings['NoReplyMessage'] : $txt['NoReplyMailDefault'] ) . ' ' . $webmaster_replyemail;
}

// Get rid of entities.
$subject = un_htmlspecialchars($subject);


With:
// Get rid of entities.
$subject = un_htmlspecialchars($subject);


Error 2
Replace:
$headers = 'From: "' . $from_name . '" <' . (empty($modSettings['mail_from']) ? (!empty($from_webmaster_email) ? $from_webmaster_email : $webmaster_email) : $modSettings['mail_from']) . '>' . $line_break;

With:
$headers = 'From: "' . $from_name . '" <' . (empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']) . '>' . $line_break;

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Ian GSD

I get it now.  The Subs-Post.php file does not contain the replace code the uninstall is expecting to find!  Here's the file.


Ian GSD

I have to assume that the file got out of sync because someone prior to me did an install or update improperly.  If I jam the missing code into the file, the uninstall tests pass.  I have not uninstalled the MOD yet, however.

I did try adding another user after making that change, no difference but mail form the site always seems to take forever, so I'm going to give it a little more time.

This makes me wonder what else may have gotten screwed up by any possibly incorrect update/install. Is there some (hopefully simple) procedure to verify/validate an installation? how about to repair it?

What is still weirding me out is that it is just this one notification function that is not working.

Kindred

no no no no no....

you can't just "jam the missing code in"

The point of those code tests is that ANOTHER mod which you installed AFTER the first one apparently changed THE SAME SECTION of code.

So, by "jamming the missing code in" you have actually made matters worse -- because in reality, what you needed to do was FIND the code section that was being looked for (but did not exactly match the mod's code) and EDIT than MANUALLY to undo the mod changes.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Ian GSD

OK, my changes removed.

In looking for the 'code section that was being looked for (but did not exactly match the mod's code) and EDIT than MANUALLY to undo the mod changes' originally, the code sections that were being looked for were missing entirely. It wasn't a matter of not getting an exact match, those lines were just not there at all.

Anyhoo, now that the lines I added are removed again, how should I proceed with uninstalling the mod, ignore the failed tests and uninstall anyway?

Advertisement: