Fixed an issue where emails were creating incorrect URLs, fixes #164.