Advertisement:

Author Topic: Email to Admin on account reactivation after email change  (Read 793 times)

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 467
  • Gender: Female
Email to Admin on account reactivation after email change
« on: September 23, 2019, 09:37:09 PM »
By default, and if the option 'Require reactivation after email change' is enabled, the email message that is sent to admins when a member reactivates their account is the same as for when a new member joins which can be a bit confusing ...

The following tip adds the option of notifying admins when an account is reactivated and sends a different email message if the option is enabled.

In ./Sources/Register.php
Find:
Code: [Select]
SELECT id_member, validation_code, member_name, real_name, email_address, is_activated, passwd, lngfileReplace With:
Code: [Select]
SELECT id_member, validation_code, member_name, real_name, email_address, is_activated, passwd, lngfile, last_login
Find:
Code: [Select]
adminNotify('activation', $row['id_member'], $row['member_name']);Replace With:
Code: [Select]
if (empty($row['last_login']))
adminNotify('activation', $row['id_member'], $row['member_name']);
elseif (isset($modSettings['notify_admin_onReactivation']) && !empty($modSettings['notify_admin_onReactivation']))
adminNotify('reactivate', $row['id_member'], $row['member_name']);

In ./Sources/Subs-Post.php
Find:
Code: [Select]
$emailtype .= '_approval';
}
Add After:
Code: [Select]
if ($type == 'reactivate')
$emailtype .= '_reactivate';

In ./Themes/default/languages/EmailTemplates.english.php
Find:
Code: [Select]
{APPROVALLINK}

{REGARDS}',
),
Add After:
Code: [Select]
'admin_notify_reactivate' => array(
/*
@additional_params: admin_notify
USERNAME:
PROFILELINK:
@description:
*/
'subject' => 'A member has reactivated their account',
'body' => 'The member {USERNAME} has reactivated their account after changing their email address. Click the link below to view their profile.
{PROFILELINK}

{REGARDS}',
),

In ./Themes/default/languages/ManageSettings.english.php
Find:
Code: [Select]
$txt['send_validation_onChange'] = 'Require reactivation after email change';Add After:
Code: [Select]
$txt['notify_admin_onReactivation'] = 'Notify admin on reactivation after email change';
In ./Sources/ManageSettings.php
Find:
Code: [Select]
array('check', 'send_validation_onChange'),Add After:
Code: [Select]
array('check', 'notify_admin_onReactivation'),

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,737
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: Email to Admin on account reactivation after email change
« Reply #1 on: September 24, 2019, 12:20:21 AM »
Approved, thank you - not a bad tip :)
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,844
  • Master of BBC Abuse
Re: Email to Admin on account reactivation after email change
« Reply #2 on: September 24, 2019, 01:09:16 AM »
Nice. Should probably be default.

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: Email to Admin on account reactivation after email change
« Reply #3 on: September 24, 2019, 09:25:00 AM »
thank you :) hadn't run into this yet but now I don't have to worry about it :D