Fix email url generation bug