4

According to the Template Manager hit count, my site is getting quite a few 404 hits. I can't seem to locate where those hits are coming in from, whether it's an one old dead link or several, etc.

I would like to have an email automatically sent to me from within my 404 template with segment data at the very least. What's the best way to do this in EE?

Stephen Callender
  • 538
  • 1
  • 5
  • 18

3 Answers3

9

The easiest way is to use an add-on that allow you to send an email from within a template. Here are two that work:

  1. "email_from_template" - http://rog.ee/email_from_template
  2. "Send Email" - http://devot-ee.com/add-ons/send-email
Stephen Callender
  • 538
  • 1
  • 5
  • 18
4

Throwing another option in here...

Enable PHP on the 404 template and include a bit of PHP. Something like

mail ( toaddress , subject , message );

Butter that up any way you wish. You could pull out things like the url being requested 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);
?>
foamcow
  • 479
  • 1
  • 3
  • 16
0

There's an free add-on that fits the bill for this: Encaf 404 Email.

Derek Hogue
  • 4,589
  • 1
  • 15
  • 27