query id added in log before sending mail