Advertisement:

Author Topic: Adding a small feature which should be default in SMF  (Read 1434 times)

Offline PLAYBOY

  • SMF Hero
  • ******
  • Posts: 2,065
  • Livephotoshop.com & Lullabyabc.com
    • Lullabies and Us
Adding a small feature which should be default in SMF
« on: October 10, 2018, 03:46:15 PM »
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?

Offline Virginiaz

  • Semi-Newbie
  • *
  • Posts: 57
Re: Adding a small feature which should be default in SMF
« Reply #1 on: October 10, 2018, 05:40:48 PM »
In Profile-Actions.php // function activateAccount($memID), find this code:

Code: [Select]
       // 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

Code: [Select]
        // 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.

Offline PLAYBOY

  • SMF Hero
  • ******
  • Posts: 2,065
  • Livephotoshop.com & Lullabyabc.com
    • Lullabies and Us
Re: Adding a small feature which should be default in SMF
« Reply #2 on: October 12, 2018, 05:50:31 AM »
It worked!!!
You`re AWESOME!

Thank you very much dude!