Order items by creation time
Batch emails in CLI in packs of 500 to avoid problems with db queries

Fix https://github.com/owncloud/apps/pull/1743/files#r12649705