• Welcome to Simple Machines Community Forum. Please login or sign up.
December 06, 2021, 08:15:07 AM

News:

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


Email to Admin on account reactivation after email change

Started by GL700Wing, September 23, 2019, 09:37:09 PM

Previous topic - Next topic

GL700Wing

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:
SELECT id_member, validation_code, member_name, real_name, email_address, is_activated, passwd, lngfile
Replace With:
SELECT id_member, validation_code, member_name, real_name, email_address, is_activated, passwd, lngfile, last_login

Find:
adminNotify('activation', $row['id_member'], $row['member_name']);
Replace With:
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:
$emailtype .= '_approval';
}

Add After:

if ($type == 'reactivate')
$emailtype .= '_reactivate';


In ./Themes/default/languages/EmailTemplates.english.php
Find:
{APPROVALLINK}

{REGARDS}',
),

Add After:
'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:
$txt['send_validation_onChange'] = 'Require reactivation after email change';
Add After:
$txt['notify_admin_onReactivation'] = 'Notify admin on reactivation after email change';

In ./Sources/ManageSettings.php
Find:
array('check', 'send_validation_onChange'),
Add After:
array('check', 'notify_admin_onReactivation'),
Life doesn't have to be perfect to be wonderful ...

Aleksi "Lex" Kilpinen

A Finnish Project Manager (Support Specialist)
 Happily running multiple SMF 2.x installations.
  Fooling around with i7-10700 @ 2,90GHz-4.80GHz / 16Gb / RTX-2070 Super / 3840x2160 / Win 10 x64


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


shadav

thank you :) hadn't run into this yet but now I don't have to worry about it :D

Advertisement: