//~OPTIONS
{
  
}

//~ARGUMENTS
{
  token: "",
}

//~TEMPLATE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
%{{
  let site           = fcf.application.getConfiguration().site;
  let friendlySite   = fcf.application.getConfiguration().friendlySite;
  let link           = site + "/fcfpackages/fcfSimpleAuthorization/login-by-email?token=" + args.token;
  let lifetime       = fcf.application.getConfiguration().fcfSimpleAuthorization_lifetimeLoginByEmailTemplate;
  let hoursString    = Math.floor(lifetime/60) == 1 ? fcf.t("hour") : fcf.t("hours");
  let minutesString  = lifetime%60 == 1 ? fcf.t("minute") : fcf.t("minutes");
  let lifetimeString = (Math.floor(lifetime/60) ? `${Math.floor(lifetime/60)} ${hoursString} `: "") + (lifetime%60 ? `${lifetime%60} ${minutesString}` : "");
}}%
<head>
</head>
<body>
<p>
!{{To log in to @{{friendlySite}}@, follow the link}}!: <a href="@{{link}}@">@{{link}}@</a>
</p>
<p>
!{{The link can only be used once and is valid for @{{lifetimeString}}@}}!.
</p>
</body>
</html>