On the new HTC One M8 you can specify which notifications to show on the lock screen and which to hide. To manage notifications on lock screen on HTC One M8 do as follows:
1. Open Settings app and go to Security.
2. Under Lock Screen settings, touch "Notification Settings"
3. Now mark the notifications types* you'd like to appear (or unmark to hide) on the lock screen
*Available options are Phone (to show or hide caller ID for missed calls), Voice mails, Text Messages (Show or hide sender and preview), Email (Show or hide sender and preview), and Calendar (Show or hide upcoming agenda