• Resolved roysmyth

    (@roysmyth)


    Hi,

    Thanks for the custom filters. I have one set up and it makes life easy for the site users.

    I’m having trouble figuring out how to implement another one. I have a value in user meta that is an expiry date (unix time stamp). I want to email all users who are coming up to expiry. That is easy. For example: expiry_date < (today + 4 weeks).

    However, expiry date can also be zero or unset, which means something else and I don’t want to email those users. So I need to test 0 < expiry_date < (today + 4 weeks).

    Is there a way to do that?

    https://wordpress.org/plugins/email-users/

Viewing 1 replies (of 1 total)
  • Plugin Author Mike Walsh

    (@mpwalsh8)

    I think the easiest way to do this would be to create another meta value (e.g. about_to_expire) that you update using the mailusers_update_custom_meta_filters hook. Something like this:

    add_action( 'mailusers_update_custom_meta_filters', 'update_about_to_expire_meta_filter', 5 );
    
    function update_publicworks_meta_filter()
    {
        //  Some logic which updates the about_to_expire meta
        //  value for all users based on the desired criteria.
    }

    Then you would use the “about_to_expire” meta filter just like you currently do with your other filter.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Filter Question’ is closed to new replies.