added 2 new hooks: beforeSendingEmail,prepareAndSendEmail.