Is there any way to trigger an email for any buyer or seller who have not had any activity for 30 days or something like that.

Also Sending reminders to users that haven't logged in for 30 days.

Unpublishing content after user has not logged in for 30 days.

Deactivate accounts after user has not logged in for 30 days.

3 Answers 3


Finally i got the answer here: https://www.drupal.org/project/inactive_user

The inactive_user module provides Drupal administrators with a way to automatically manage inactive user accounts. This module has two goals: to help keep users coming back to your site by reminding them when they've been away for a configurable period of time, and to cleanup unused accounts.

And another possible solution is: Using rules for more advanced functionality would involve something similar to the following

Create a new Rule Set that passes the User and (possibly) a Date argument

Add a Check a truth value condition that verifies something like [user:user-last-login-raw] + 2592000 < [user:date-in-tz] (2592000 is 30 days in seconds)

Add a Send a mail to a user action

Save that rule set and then do the following:

Create a new triggered rule for User has logged out event Add a Schedule "your rule set" action and pass +30 days as the Scheduled evaluation date

  • Using the Rules module as you described above is definitely a valid approach. But are you sure you want to consider that "inactive user" module? That module would be like a red flag (= no go) for me, because it only has a DEV version for D7, status "unsupported". Commented Feb 25, 2016 at 13:32
  • 1
    You can use this module, but a simple hook_cron function can do the exact thing that you need and two queries.
    – NTT
    Commented Feb 26, 2016 at 9:24

You can use hook_cron, you can compare today's date and the seller not having any activity date and send an email.

function modulename_cron(){
   //your code
   //compare dates and send email 

Have a look at my answer to "Rule to store user's last post date and scheduled rule based 30 day reminder", which seems like a variation (not a duplicate) of your question. It uses the Rules module and includes a Rule and a Rules Component (both in Rules export format) that should help you to answer your question.

In your case, these tunings would apply:

  • Create a variation of the "field_next_article" field (as in Step 1), and name it something like "field_next_activity_deadline" (such name change is not really needed, but makes it more easy to understand your rule).

  • Adapt the eMail content in the Rules Component from Step 2 (how to adapt it is only limited by your own imagination ...).

  • Review the "Rules Event" in the rule from Step 3, to make it match with what you mean/expect by your "... any buyer or seller who have not had any activity ...". If you're fine with using the event "User logged in" then you're good to go. Otherwise, or additionally, you may want to use some other mechanism for the actual trigger of this Rules Component (to send the actual eMail). Here are 2 typical alternatives for such trigger:

    • Create a view (using Views), use the Views Bulk Operations (VBO) module for it, and then trigger the Rules component (from Step 2) as a VBO action.
    • When a seller of buyer performs some type of transaction on your site, have that "event" intercepted via Rules (via an extra Rule you'd write), and then use a Rules Action to just update the 30-days deadline of your field_next_activity_deadline field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.