Fixed #17431 by adding a construct_mail method to PasswordResetForm.

- This method can be overwritten to provide fine tunning on how the
email is constructed.
- Credits of the patch go to ejucovy.
Added tests and documentation to fix of #17431.

- Credits for the patch go to ejucovy.