[FIX] allow password reset/invitation emails to use database name passed on query string

allow password reset links to work if there is a second database on the server