public static void sendMailToOnlinePlayers(String title, String body, List<ItemInstance> items) {
GameObjectsStorage.getPlayersStream().forEach(p -> {
Mail mail = new Mail();
mail.setSenderId(1);
mail.setSenderName("System");
mail.setReceiverId(p.getObjectId());
mail.setReceiverName(p.getName());
mail.setTopic(title);
mail.setBody(body);
// item section
items.forEach(mail::addAttachment);
mail.setUnread(true);
mail.setType(Mail.SenderType.NORMAL);
mail.setExpireTime(720 * 3600 + (int) (System.currentTimeMillis() / 1000L));
mail.save();
p.sendPacket(ExNoticePostArrived.STATIC_TRUE);
p.sendPacket(SystemMsg.THE_MAIL_HAS_ARRIVED);
}
);
}