News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Adding a small feature which should be default in SMF

Started by PLAYBOY, October 10, 2018, 03:46:15 PM

Previous topic - Next topic

PLAYBOY

When people ask to become a member in your forum and you go to their profile and click on "Approve", they don`t get an email notification saying their membership has been approved. So they dont know about the approval and not participate in the forum.

However if you go through the admin panel and approve the member there, then they get a notification email.

So can someone please help me to copy & paste the code from admin panel to the profile page so when you click on the approve button on the profile page the person gets an email notification about the approval of their membership?

I don`t understand the reason why they didn`t add this in the default settings like who would NOT want to notify the member upon approving their membership from their profile?

vii

In Profile-Actions.php // function activateAccount($memID), find this code:


       // Make sure we update the stats too.
        updateStats('member', false);


Add this directly after the above code, but before the } bracket that closes the parent conditional statement


        // Send approval email
        global $scripturl;

        // Needed for email template function
        require_once($sourcedir . '/Subs-Post.php');

        $replacements = array(
            'NAME' => $user_profile[$memID]['member_name'],
            'USERNAME' => $user_profile[$memID]['real_name'],
            'PROFILELINK' => $scripturl . '?action=profile;u=' . $memID,
            'FORGOTPASSWORDLINK' => $scripturl . '?action=reminder',
        );
        $emaildata = loadEmailTemplate('admin_approve_accept', $replacements, $member['language']);
        sendmail($user_profile[$memID]['email_address'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);


Let me know if that works. The code I got the email stuff from was ManageMembers.php, around lines 1130 - 1238.

I don't have time to test it, but it looks like it should work.

PLAYBOY

It worked!!!
You`re AWESOME!

Thank you very much dude!

Advertisement: