ExpressionEngine - email notification when visiting 404 pages?

In accordance with the number of visits to the template, my site receives quite a lot of 404 hits. It seems I can’t find where these hits come from, whether it's an old dead link or a few, etc.

I would like for an email to be automatically sent from my 404 template with segment data. What is the best way to do this in EE?

+4
source share
3 answers

The easiest way is to use an add-in that allows you to send email inside the template. Here are two that work:

+9
source

Throwing another option here ...

Include PHP in 404 template and include some PHP. Sort of

mail ( toaddress , subject , message ); 

Oil as you wish. You can pull out things like the requested url and include them in the email.

 <?php $url = 'http'.(empty($_SERVER['HTTPS'])?'':'s').'://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; mail(' me@myemail.com ','404 on website','Hit 404 page on site for URL: '.$url); ?> 
+4
source

There is a free add-in that matches this account: Encaf 404 Email .

0
source

Source: https://habr.com/ru/post/1442039/


All Articles