# find & notify users that didn't logged in >6 months and send mail to log in again
for u in $(${friendicapath}/bin/console user list active -c 10000| grep -v '.*---.*'| sed 's/|/;/g'| tr -s "\ "| sed 's/^;\ //g'| sed 's/\ ;\ /;/g'| sed 's/\ /_/g'| tail -n +2 );do
# delete account when last login is older than 7 months and send mail about deletion
# you should copy & paste the text from 6 months for the first runs of this script
# and later change the text to a notification that the account has been deleted.
( cat <<EOF
Dear ${dispname},
you have registered on ${siteurl}${registered} and haven't logged in again ${lastlogin}.
Your latest post - if any - was ${lastpost}.
If you want to continue to keep your account on Nerdica then please log in at least every 6 months to keep your account alive. Otherwise we assume that you don't want to use it anymore and will cancel your account 7 months after your last login.
You can access your profile at ${profileurl} or you can cancel your account on your own when logged in at ${siteurl}/removeme - however we would like to see you become an active user again and contribute to the Fediverse, but of course it's up to you.
Sincerely,
your ${site} admins
EOF
)| sed 's/_/\ /g'| /usr/bin/mail -s "The Fediverse misses you, ${username}!" -r "${sitefrom}" -b "$siteadmin" -- "${usermail}"
you have registered on ${siteurl}${registered} and haven't logged in again ${lastlogin}.
Your latest post - if any - was ${lastpost}.
If you want to continue to keep your account on Nerdica then please log in at least every 6 months to keep your account alive. Otherwise we assume that you don't want to use it anymore and will cancel your account 7 months after your last login.
You can access your profile at ${profileurl} or you can cancel your account on your own when logged in at ${siteurl}/removeme - however we would like to see you become an active user again and contribute to the Fediverse, but of course it's up to you.
Sincerely,
your ${site} admins
EOF
)| sed 's/_/\ /g'| /usr/bin/mail -s "The Fediverse misses you, ${username}!" -r "${sitefrom}" -b "$siteadmin" -- "${usermail}"