ip addresses in user action log emails Topic is solved
Moderators: mandville, General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant / FPA - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant / FPA - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
-
- Joomla! Apprentice
- Posts: 26
- Joined: Mon Jan 26, 2009 3:44 am
ip addresses in user action log emails
Joomla 3.x included ip addresses in user action log emails, but joomla 4 does not. Is there a way to turn that on in Joomla 4?
Thanksl
Thanksl
- mjparadac
- Joomla! Hero
- Posts: 2488
- Joined: Mon Oct 29, 2012 3:58 pm
Re: ip addresses in user action log emails
Hello jtalbot,
Click System, then Global Configuration, then find and click User Actions Log, enable the IP Logging option.
Regards,
Click System, then Global Configuration, then find and click User Actions Log, enable the IP Logging option.
Regards,
You do not have the required permissions to view the files attached to this post.
Joomla Community Ambassador for A2 Hosting | A2 Hosting - Our speed, your success | https://www.a2hosting.com/joomla-hosting
-
- Joomla! Apprentice
- Posts: 26
- Joined: Mon Jan 26, 2009 3:44 am
Re: ip addresses in user action log emails
Thanks for the reply and the screenshot, but ip logging is already enabled and still the emails don't include the ip address.
- AMurray
- Joomla! Exemplar
- Posts: 9913
- Joined: Sat Feb 13, 2010 7:35 am
- Location: Australia
Re: ip addresses in user action log emails
Perhaps you need to edit the relevant email template, and include the IP address field/place-holder?
It may not do so by default, but J4's email templating function allows easy editing of system emails templates, and I believe it includes the User Action Log email message.
It may not do so by default, but J4's email templating function allows easy editing of system emails templates, and I believe it includes the User Action Log email message.
Regards - A Murray
General Support Moderator
General Support Moderator
-
- Joomla! Apprentice
- Posts: 26
- Joined: Mon Jan 26, 2009 3:44 am
Re: ip addresses in user action log emails
Thanks @AMurray for suggesting the email templating stuff. The User Actions Log email is indeed listed there, but ip address is not one of the available tags for the user actions log email
- AMurray
- Joomla! Exemplar
- Posts: 9913
- Joined: Sat Feb 13, 2010 7:35 am
- Location: Australia
Re: ip addresses in user action log emails
Perhaps it simply can't be included in the email. It may have been removed since Joomla 3.
Did you switch on the IP Logging as suggested by @mjparadac? Maybe that also then turns "on" the ability to select the IP field for the email message.
Did you switch on the IP Logging as suggested by @mjparadac? Maybe that also then turns "on" the ability to select the IP field for the email message.
Regards - A Murray
General Support Moderator
General Support Moderator
- toivo
- Joomla! Master
- Posts: 17516
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Sydney, Australia
Re: ip addresses in user action log emails
The below experiment with Joomla 4.2.4 shows that a couple of minor additions to the Joomla core are needed to make the IP address available to different mail templates.
A modified version of the file administrator\components\com_actionlogs\src\Model\ActionlogModel.php is attached. Do not copy it to a live production environment! Here is a summary of the modifications:
line 87
Code: Select all
$this->sendNotificationEmails($loggedMessages, $user->name, $ip, $context);
Code: Select all
protected function sendNotificationEmails($messages, $username, $ip, $context)
Code: Select all
$m['ipaddress'] = $ip;
Code: Select all
{"tags":["name","sitename","activate","siteurl","username","ipaddress"]}
I will create a feature request in https://issues.joomla.org so that developers can consider this addition to mail templates for inclusion in one of the future versions.
You do not have the required permissions to view the files attached to this post.
Toivo Talikka, Global Moderator
-
- Joomla! Apprentice
- Posts: 26
- Joined: Mon Jan 26, 2009 3:44 am
Re: ip addresses in user action log emails
Great, thanks so much for doing this.toivo wrote: ↑Tue Nov 08, 2022 12:49 pmI will create a feature request in https://issues.joomla.org so that developers can consider this addition to mail templates for inclusion in one of the future versions.
- toivo
- Joomla! Master
- Posts: 17516
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Sydney, Australia
Re: ip addresses in user action log emails
A feature request has now been submitted at
[#39190] - [4.3]Make IP address available in action log and other email templates.
[#39190] - [4.3]Make IP address available in action log and other email templates.
Toivo Talikka, Global Moderator
-
- Joomla! Hero
- Posts: 2990
- Joined: Fri Jul 05, 2013 10:35 am
- Location: Parts Unknown
Re: ip addresses in user action log emails
[ redacted ]
You don't need the first two changes. IP address is already included in the message.
You don't need the first two changes. IP address is already included in the message.
Last edited by toivo on Sat Nov 12, 2022 12:08 am, edited 1 time in total.
Reason: mod note: removed long quote
Reason: mod note: removed long quote
- toivo
- Joomla! Master
- Posts: 17516
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Sydney, Australia
Re: ip addresses in user action log emails
@SharkyKZ, you are absolutely right. The only mod required will therefore be this:
Code: Select all
$m['ipaddress'] = $message->ip_address;
Toivo Talikka, Global Moderator
-
- Joomla! Apprentice
- Posts: 26
- Joined: Mon Jan 26, 2009 3:44 am
Re: ip addresses in user action log emails
I don't think the feature request has been implemented yet :^(, but in preparation, I added "ipaddress" to the 'params' column of the mail_templates database table, in the row for template_id com_actionlogs.notification:
I then edited the mail template "User Actions Log: Notification Mail" as follows (IPADDRESS did show up in the tag list for this template):
Now when I get an action log email, it contains (the literal) {IPADDRESS}; I assume it will be replaced by an actual ip address when the feature is implemented.
Code: Select all
{"tags":["message","date","extension","username","ipaddress"]}
Code: Select all
Action | Date | Extension | Name | IP Address
{MESSAGES} {MESSAGE} | {DATE} | {EXTENSION} | {USERNAME} | {IPADDRESS}
{/MESSAGES}
-
- Joomla! Apprentice
- Posts: 26
- Joined: Mon Jan 26, 2009 3:44 am
Re: ip addresses in user action log emails
When asked to vote on the importance of an issue in the Joomla issue tracker, which one is higher importance - importance 1 or importance 5?
- AMurray
- Joomla! Exemplar
- Posts: 9913
- Joined: Sat Feb 13, 2010 7:35 am
- Location: Australia
Re: ip addresses in user action log emails
I assume 5 is the highest and 1 is the lowest. That's usually the way I would read such things when it comes to votes or ratings.
Regards - A Murray
General Support Moderator
General Support Moderator