Take the 2-minute tour ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

I have a page that lists programs people can donate to for a non-profit. This list is updated from a separate database. The current flow takes the entries offline via using Solspace Import to mark them closed, then a second import will edit or add new entries. Those that are still active are then marked open and the list is once again live and ready for people to use.

However, things can and do go wrong. We would not want this list to be blank. I currently have a notice in the no_results tag that asks the user to email the admin if they see that message. A preferred method would be to have the system send an email if the no_results tag is displayed.

Any ideas how to implement this or something similar? Anything that lets us know the list is blank will work.

share|improve this question

2 Answers 2

up vote 6 down vote accepted

Take a look at Email-from-Template.

This plugin sends its tag contents in an email (with or without echoing that content back to the template).

By placing it in a template, and inside a conditional if necessary, you can trigger an email to be sent as needed.

Example Usage:

{exp:email_from_template to="admin@ee.com" from="server@ee.com" subject="Hello!" echo="off"}

   This tag content is being viewed at {uri_string}.
   Sending notification to {to}.

{/exp:email_from_template}

I did a quick test and if you wrap something similar to the above example in a no_results conditional it works perfectly. Should be just what you need to send an email when there are no results.

share|improve this answer
    
perfect, thanks. –  Doug Dec 11 '12 at 1:45

There's an addon Encaf 404 Email which is pretty close to what you need. It is triggered on a 404 error. If you know php perhaps you could use that add-on as a guide on creating your own plugin to achieve what you need.

Another possibility is Postmaster, though I'm not sure that it will do what you need either.

share|improve this answer
    
Postmaster v1.2 can send an email using the channel entries loop, but I have never done it only for no_results. V1.2 is due out in the next week, but I am happy to give the beta build to anyone with a valid license. –  Justin Kimbrell Dec 10 '12 at 18:22
    
Will Postmaster be able to do what I need? ie user goes to page. They get the 'no_results' message that says the admin has been notified. Postmaster sends an email to the admins. –  Doug Dec 10 '12 at 18:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.