add generate function of mailHash and mediaId.