- match userid with
- Some userid ->
- (* Existing user account - send reminder. *)
- template_exists#set "username" username;
- template_exists#set "hostname" hostname;
- template_exists#to_string
-
- | None ->
+ try
+ (match sth#fetch1 () with
+ [ `Int userid; `Null ] ->
+ (* Existing user account - send reminder. *)
+ template_exists#set "username" username;
+ template_exists#set "hostname" hostname;
+ template_exists#to_string
+
+ | [ `Int userid; `String invite ] ->
+ (* Existing user account - resend the invite. *)
+ template#set "username" username;
+ template#set "hostname" hostname;
+ template#set "invite" invite;
+ template#to_string
+
+ | _ -> assert false)
+ with
+ Not_found ->