Improve confirmation mails
Change-Id: Ida840dfc4c4477fd8b86a7dcb640360c96c99be1
diff --git a/utils.php b/utils.php
index 5c2f399..d50cc24 100644
--- a/utils.php
+++ b/utils.php
@@ -53,3 +53,16 @@
return $TEMPLATE;
}
+
+function replace_all_user_variables(string $string, User $user, string $url)
+{
+ $string = str_replace("{{url}}", $url, $string);
+ $string = str_replace("{{full_name}}", $user->first_name . " " . $user->last_name, $string);
+ $string = str_replace("{{fullname}}", $user->first_name . " " . $user->last_name, $string);
+ $string = str_replace("{{first_name}}", $user->first_name, $string);
+ $string = str_replace("{{last_name}}", $user->last_name, $string);
+ $string = str_replace("{{email}}", $user->email, $string);
+ $string = str_replace("{{organization}}", $user->organization, $string);
+ $string = str_replace("{{username}}", $user->user_name, $string);
+ return $string;
+}
\ No newline at end of file