code: def _url_for_email(endpoint, base_url=None, **kw):
      
      base_url = base_url or config("MAIL_EXTERNAL_BASE_URL")
      _external = True if not base_url else False
      url = url_for(endpoint, _external=_external, **kw)
      if base_url and not _external:
          url = "%s/%s" % (base_url.strip("/"), url.lstrip("/"))
      return url
docs: Create an external url_for by using a custom base_url different from the domain we
      are on
      :param endpoint:
      :param base_url:
      :param kw:
      :return: