Email Alerts for non logged users more than 30 days


I want to know is there we can send automated email trigger for non logged users in Nextcloud for a particular date period.

For example:
If a user is not logged in to their nextcloud account for a month. The Nextcloud Application has to detect the users from Last Login Date & sends an automated email trigger to the user that Hi you haven’t Logged in for more than a month.

Is there any options to send an automated email trigger.

Sorry i do not know a program for that. But maybe you can program something like this.

I don’t think there is built-in alert for it.

but you can easily combine occ user:list and occ user:lastseen and detect login older than specific date (keep in mind --output=json and --info parameter)

Using the occ command — Nextcloud latest Administration Manual latest documentation

UPDATE: as it seems to be common request:

I crafted a command to display only user_id and last_seen from occ user:list command

occ user:list --output=json --info| jq '.[] | {user_id, last_seen}'

will show json formated list of users with their last login time stamp e.g.

  "user_id": "test6",
  "last_seen": "2022-06-27T20:40:39+00:00"
  "user_id": "test7",
  "last_seen": "2022-06-28T19:38:48+00:00"


occ user:list --output=json --info| jq '.[] | [.user_id, .last_seen]|@csv'

will output the list as CSV