diff --git a/core/Api/User/Register.php b/core/Api/User/Register.php
new file mode 100644
index 0000000..b8cfad2
--- /dev/null
+++ b/core/Api/User/Register.php
@@ -0,0 +1,46 @@
+user->isLoggedIn()) {
+ $this->lastError = L('You are already logged in');
+ $this->success = false;
+ return false;
+ }
+
+ if (!parent::execute($values)) {
+ return false;
+ }
+
+ if($this->success) {
+ $email = $this->getParam('email');
+ $token = generateRandomString(36);
+ $request = new SendMail($this->user);
+ $link = "http://localhost/acceptInvitation?token=$token";
+ $this->success = $request->execute(array(
+ "from" => "webmaster@romanh.de",
+ "to" => $email,
+ "subject" => "Account Invitation for web-base@localhost",
+ "body" =>
+ "Hello,
+you were invited to create an account on web-base@localhost. Click on the following link to confirm the registration, it is 48h valid from now.
+If the invitation was not intended, you can simply ignore this email.
$link"
+ )
+ );
+ $this->lastError = $request->getLastError();
+ }
+ return $this->success;
+ }
+}
\ No newline at end of file