ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

entry expiration notification without member login

July 13, 2011 5:44pm

Subscribe [4]
  • #1 / Jul 13, 2011 5:44pm

    brittanyA

    184 posts

    I have a client that is adamantly against member accounts (he doesn’t want users to have to login). However, users contribute “listings” to this site. The way I’ve set it up is that a guest submits a safecracker form, automatically the entry is set to “pending” and then my client approves the entry. Pretty standard.

    However, my client wants these entries to expire after 1 year. At that point, he wants an email notification to go to the guest that submitted the entry, as well as to him. The guest’s email is captured through a standard safecracker text input.

    What is the best way to accomplish this? I’ve tried to think of a native way and searched exhaustively for plugins, but I can’t seem to find a solution that doesn’t involve member login.

    Any ideas?

    Thanks so much!

  • #2 / Jul 14, 2011 9:02am

    Sue Crocker

    26054 posts

    You’re going to need some sort of custom solution for this.

    In theory, I’d create a cron job to do this - check the database for entries that have expired that day, capture the email address, and send the mail. You might want to consider working with someone in the Pro Network for this functionality. In the meantime, moving to the Community Help forum for additional community support.

  • #3 / Jul 14, 2011 9:36am

    the3mus1can

    426 posts

    The expiration_date, set 1 year in the future, can be done via the safecracker form with a hidden input and a little PHP.

    //This is the format needed: YYYY-MM-DD hh:mm PM/AM
    <input type="hidden" name="expiration_date" value="<?= strftime('%Y-%m-%d', strtotime('+1 year', time()); ?> 12:00 AM" />

    As for the notification that will take a small amount of custom development.

  • #4 / Jul 15, 2011 10:10am

    brittanyA

    184 posts

    Thanks for the feedback! I will probably need to go the custom dev route. Is it possible to just send my client an email when an entry has been published for 12 months (disregarding the guest email notification), or is that custom as well?

  • #5 / Jul 15, 2011 10:53pm

    the3mus1can

    426 posts

    Actually, this was just put out a few days ago that might help: http://devot-ee.com/add-ons/nsm-publish-plus-workflow/.

    It would require manual configuration in the CP, but could be what you need.  If you want things to be automated you would probably have to go the custom dev route.

  • #6 / Dec 28, 2011 8:17pm

    APGWest

    295 posts

    Just a quick FYI - the code the3mus1can posted works great but the snippet is missing a closing parenthesis ‘)’ just before the semi-colon.

    //This is the format needed: YYYY-MM-DD hh:mm PM/AM
    <input type="hidden" name="expiration_date" value="<?= strftime('%Y-%m-%d', strtotime('+1 year', time())); ?> 12:00 AM" />
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases