Index: springapp/src/main/java/mk/profesori/springapp/Model/ConfirmationToken.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/ConfirmationToken.java	(revision 6c1d611d2c6065f94a6ce7aba685af562d15971f)
+++ springapp/src/main/java/mk/profesori/springapp/Model/ConfirmationToken.java	(revision b7ec74e9eb06c0df7df42fee97077dfa366495fb)
@@ -38,5 +38,5 @@
     private LocalDateTime confirmedAt;
 
-    @ManyToOne
+    @ManyToOne()
     @JoinColumn(nullable = false, name = "custom_user_details_id")
     private CustomUserDetails customUserDetails;
Index: springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java	(revision 6c1d611d2c6065f94a6ce7aba685af562d15971f)
+++ springapp/src/main/java/mk/profesori/springapp/Model/CustomUserDetails.java	(revision b7ec74e9eb06c0df7df42fee97077dfa366495fb)
@@ -3,5 +3,8 @@
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
 
+import javax.persistence.CascadeType;
 import javax.persistence.Entity;
 import javax.persistence.EnumType;
@@ -10,4 +13,5 @@
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
+import javax.persistence.OneToMany;
 import javax.persistence.SequenceGenerator;
 
@@ -40,4 +44,6 @@
     private Boolean locked = false;
     private Boolean enabled = false;
+    @OneToMany(mappedBy = "customUserDetails", cascade = CascadeType.ALL)
+    private Set<ConfirmationToken> confirmationTokens = new HashSet<>();
 
     public CustomUserDetails(String fullName, String username, String email, String password, UserRole userRole) {
Index: springapp/src/main/java/mk/profesori/springapp/Service/CustomUserDetailsService.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Service/CustomUserDetailsService.java	(revision 6c1d611d2c6065f94a6ce7aba685af562d15971f)
+++ springapp/src/main/java/mk/profesori/springapp/Service/CustomUserDetailsService.java	(revision b7ec74e9eb06c0df7df42fee97077dfa366495fb)
@@ -38,15 +38,4 @@
 
     public String signUp(CustomUserDetails customUserDetails) {
-
-        boolean emailExists = userRepository.findByEmail(customUserDetails.getEmail()).isPresent();
-        if(emailExists) {
-            throw new IllegalStateException("Email is taken");
-        }
-
-        boolean usernameExists = userRepository.findByUsername(customUserDetails.getUsername()).isPresent();
-        if(usernameExists) {
-            throw new IllegalStateException("Username is taken");
-        }
-
         String encodedPassword = passwordEncoder().encode(customUserDetails.getPassword());
         customUserDetails.setPassword(encodedPassword);
@@ -54,4 +43,10 @@
         userRepository.save(customUserDetails);
 
+        String token = createToken(customUserDetails);
+
+        return token;
+    }
+
+    public String createToken(CustomUserDetails customUserDetails) {
         String token = UUID.randomUUID().toString();
         ConfirmationToken confirmationToken = new ConfirmationToken(
Index: springapp/src/main/java/mk/profesori/springapp/Service/EmailSender.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Service/EmailSender.java	(revision 6c1d611d2c6065f94a6ce7aba685af562d15971f)
+++ springapp/src/main/java/mk/profesori/springapp/Service/EmailSender.java	(revision b7ec74e9eb06c0df7df42fee97077dfa366495fb)
@@ -3,3 +3,4 @@
 public interface EmailSender {
     void send(String to, String email);
+    String buildEmail(String username, String link);
 }
Index: springapp/src/main/java/mk/profesori/springapp/Service/EmailService.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Service/EmailService.java	(revision 6c1d611d2c6065f94a6ce7aba685af562d15971f)
+++ springapp/src/main/java/mk/profesori/springapp/Service/EmailService.java	(revision b7ec74e9eb06c0df7df42fee97077dfa366495fb)
@@ -37,3 +37,73 @@
     }
 
+    @Override
+    public String buildEmail(String username, String link) {
+        return "<div style=\"font-family:Helvetica,Arial,sans-serif;font-size:16px;margin:0;color:#0b0c0c\">\n" +
+                "\n" +
+                "<span style=\"display:none;font-size:1px;color:#fff;max-height:0\"></span>\n" +
+                "\n" +
+                "  <table role=\"presentation\" width=\"100%\" style=\"border-collapse:collapse;min-width:100%;width:100%!important\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n" +
+                "    <tbody><tr>\n" +
+                "      <td width=\"100%\" height=\"53\" bgcolor=\"#0b0c0c\">\n" +
+                "        \n" +
+                "        <table role=\"presentation\" width=\"100%\" style=\"border-collapse:collapse;max-width:580px\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">\n" +
+                "          <tbody><tr>\n" +
+                "            <td width=\"70\" bgcolor=\"#0b0c0c\" valign=\"middle\">\n" +
+                "                <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse\">\n" +
+                "                  <tbody><tr>\n" +
+                "                    <td style=\"padding-left:10px\">\n" +
+                "                  \n" +
+                "                    </td>\n" +
+                "                    <td style=\"font-size:28px;line-height:1.315789474;Margin-top:4px;padding-left:10px\">\n" +
+                "                      <span style=\"font-family:Helvetica,Arial,sans-serif;font-weight:700;color:#ffffff;text-decoration:none;vertical-align:top;display:inline-block\">Активирај ја својата корисничка сметка</span>\n" +
+                "                    </td>\n" +
+                "                  </tr>\n" +
+                "                </tbody></table>\n" +
+                "              </a>\n" +
+                "            </td>\n" +
+                "          </tr>\n" +
+                "        </tbody></table>\n" +
+                "        \n" +
+                "      </td>\n" +
+                "    </tr>\n" +
+                "  </tbody></table>\n" +
+                "  <table role=\"presentation\" class=\"m_-6186904992287805515content\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse;max-width:580px;width:100%!important\" width=\"100%\">\n" +
+                "    <tbody><tr>\n" +
+                "      <td width=\"10\" height=\"10\" valign=\"middle\"></td>\n" +
+                "      <td>\n" +
+                "        \n" +
+                "                <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse\">\n" +
+                "                  <tbody><tr>\n" +
+                "                    <td bgcolor=\"#1D70B8\" width=\"100%\" height=\"10\"></td>\n" +
+                "                  </tr>\n" +
+                "                </tbody></table>\n" +
+                "        \n" +
+                "      </td>\n" +
+                "      <td width=\"10\" valign=\"middle\" height=\"10\"></td>\n" +
+                "    </tr>\n" +
+                "  </tbody></table>\n" +
+                "\n" +
+                "\n" +
+                "\n" +
+                "  <table role=\"presentation\" class=\"m_-6186904992287805515content\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse;max-width:580px;width:100%!important\" width=\"100%\">\n" +
+                "    <tbody><tr>\n" +
+                "      <td height=\"30\"><br></td>\n" +
+                "    </tr>\n" +
+                "    <tr>\n" +
+                "      <td width=\"10\" valign=\"middle\"><br></td>\n" +
+                "      <td style=\"font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:1.315789474;max-width:560px\">\n" +
+                "        \n" +
+                "            <p style=\"Margin:0 0 20px 0;font-size:19px;line-height:25px;color:#0b0c0c\">Здраво " + username + ",</p><p style=\"Margin:0 0 20px 0;font-size:19px;line-height:25px;color:#0b0c0c\"> Добредојде на profesori.mk!. Да ја активираш својата корисничка сметка, кликни на линкот долу: </p><blockquote style=\"Margin:0 0 20px 0;border-left:10px solid #b1b4b6;padding:15px 0 0.1px 15px;font-size:19px;line-height:25px\"><p style=\"Margin:0 0 20px 0;font-size:19px;line-height:25px;color:#0b0c0c\"> <a href=\"" + link + "\">Активирај</a> </p></blockquote>\n Линкот истекува за 10 минути. <p>Убав престој!</p>" +
+                "        \n" +
+                "      </td>\n" +
+                "      <td width=\"10\" valign=\"middle\"><br></td>\n" +
+                "    </tr>\n" +
+                "    <tr>\n" +
+                "      <td height=\"30\"><br></td>\n" +
+                "    </tr>\n" +
+                "  </tbody></table><div class=\"yj6qo\"></div><div class=\"adL\">\n" +
+                "\n" +
+                "</div></div>";
+    }
+
 }
Index: springapp/src/main/java/mk/profesori/springapp/Service/RegistrationService.java
===================================================================
--- springapp/src/main/java/mk/profesori/springapp/Service/RegistrationService.java	(revision 6c1d611d2c6065f94a6ce7aba685af562d15971f)
+++ springapp/src/main/java/mk/profesori/springapp/Service/RegistrationService.java	(revision b7ec74e9eb06c0df7df42fee97077dfa366495fb)
@@ -12,4 +12,5 @@
 import mk.profesori.springapp.Model.RegistrationRequest;
 import mk.profesori.springapp.Model.UserRole;
+import mk.profesori.springapp.Repository.UserRepository;
 
 @Service
@@ -23,4 +24,5 @@
     private final UsernameValidator usernameValidator;
     private final EmailSender emailSender;
+    private final UserRepository userRepository;
     
     public String register(RegistrationRequest request) {
@@ -34,4 +36,21 @@
         boolean isValidUsername = usernameValidator.test(request.getUsername());
         if(!isValidUsername) throw new IllegalStateException("Invalid username");
+
+        boolean emailExists = userRepository.findByEmail(request.getEmail()).isPresent();
+        if(emailExists) {
+            if(!userRepository.findByEmail(request.getEmail()).get().isEnabled()) {
+                String tokenToResend = customUserDetailsService.createToken(userRepository.findByEmail(request.getEmail()).get());
+                String link = "http://192.168.0.17:8080/registration/confirm?token=" + tokenToResend;
+                emailSender.send(request.getEmail(), emailSender.buildEmail(request.getUsername(), link));
+                return tokenToResend; 
+            } else {
+            throw new IllegalStateException("Email is taken");
+            }
+        }
+
+        boolean usernameExists = userRepository.findByUsername(request.getUsername()).isPresent();
+        if(usernameExists) {
+            throw new IllegalStateException("Username is taken");
+        }
 
         String token = customUserDetailsService.signUp(
@@ -47,5 +66,5 @@
         String link = "http://192.168.0.17:8080/registration/confirm?token=" + token;
         
-        emailSender.send(request.getEmail(), buildEmail(request.getUsername(), link));
+        emailSender.send(request.getEmail(), emailSender.buildEmail(request.getUsername(), link));
         
         return token;
@@ -74,72 +93,3 @@
         return "Confirmed";
     }
-
-    private String buildEmail(String username, String link) {
-        return "<div style=\"font-family:Helvetica,Arial,sans-serif;font-size:16px;margin:0;color:#0b0c0c\">\n" +
-                "\n" +
-                "<span style=\"display:none;font-size:1px;color:#fff;max-height:0\"></span>\n" +
-                "\n" +
-                "  <table role=\"presentation\" width=\"100%\" style=\"border-collapse:collapse;min-width:100%;width:100%!important\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n" +
-                "    <tbody><tr>\n" +
-                "      <td width=\"100%\" height=\"53\" bgcolor=\"#0b0c0c\">\n" +
-                "        \n" +
-                "        <table role=\"presentation\" width=\"100%\" style=\"border-collapse:collapse;max-width:580px\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">\n" +
-                "          <tbody><tr>\n" +
-                "            <td width=\"70\" bgcolor=\"#0b0c0c\" valign=\"middle\">\n" +
-                "                <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse\">\n" +
-                "                  <tbody><tr>\n" +
-                "                    <td style=\"padding-left:10px\">\n" +
-                "                  \n" +
-                "                    </td>\n" +
-                "                    <td style=\"font-size:28px;line-height:1.315789474;Margin-top:4px;padding-left:10px\">\n" +
-                "                      <span style=\"font-family:Helvetica,Arial,sans-serif;font-weight:700;color:#ffffff;text-decoration:none;vertical-align:top;display:inline-block\">Активирај ја својата корисничка сметка</span>\n" +
-                "                    </td>\n" +
-                "                  </tr>\n" +
-                "                </tbody></table>\n" +
-                "              </a>\n" +
-                "            </td>\n" +
-                "          </tr>\n" +
-                "        </tbody></table>\n" +
-                "        \n" +
-                "      </td>\n" +
-                "    </tr>\n" +
-                "  </tbody></table>\n" +
-                "  <table role=\"presentation\" class=\"m_-6186904992287805515content\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse;max-width:580px;width:100%!important\" width=\"100%\">\n" +
-                "    <tbody><tr>\n" +
-                "      <td width=\"10\" height=\"10\" valign=\"middle\"></td>\n" +
-                "      <td>\n" +
-                "        \n" +
-                "                <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse\">\n" +
-                "                  <tbody><tr>\n" +
-                "                    <td bgcolor=\"#1D70B8\" width=\"100%\" height=\"10\"></td>\n" +
-                "                  </tr>\n" +
-                "                </tbody></table>\n" +
-                "        \n" +
-                "      </td>\n" +
-                "      <td width=\"10\" valign=\"middle\" height=\"10\"></td>\n" +
-                "    </tr>\n" +
-                "  </tbody></table>\n" +
-                "\n" +
-                "\n" +
-                "\n" +
-                "  <table role=\"presentation\" class=\"m_-6186904992287805515content\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse;max-width:580px;width:100%!important\" width=\"100%\">\n" +
-                "    <tbody><tr>\n" +
-                "      <td height=\"30\"><br></td>\n" +
-                "    </tr>\n" +
-                "    <tr>\n" +
-                "      <td width=\"10\" valign=\"middle\"><br></td>\n" +
-                "      <td style=\"font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:1.315789474;max-width:560px\">\n" +
-                "        \n" +
-                "            <p style=\"Margin:0 0 20px 0;font-size:19px;line-height:25px;color:#0b0c0c\">Здраво " + username + ",</p><p style=\"Margin:0 0 20px 0;font-size:19px;line-height:25px;color:#0b0c0c\"> Добредојде на profesori.mk!. Да ја активираш својата корисничка сметка, кликни на линкот долу: </p><blockquote style=\"Margin:0 0 20px 0;border-left:10px solid #b1b4b6;padding:15px 0 0.1px 15px;font-size:19px;line-height:25px\"><p style=\"Margin:0 0 20px 0;font-size:19px;line-height:25px;color:#0b0c0c\"> <a href=\"" + link + "\">Активирај</a> </p></blockquote>\n Линкот истекува за 10 минути. <p>Убав престој!</p>" +
-                "        \n" +
-                "      </td>\n" +
-                "      <td width=\"10\" valign=\"middle\"><br></td>\n" +
-                "    </tr>\n" +
-                "    <tr>\n" +
-                "      <td height=\"30\"><br></td>\n" +
-                "    </tr>\n" +
-                "  </tbody></table><div class=\"yj6qo\"></div><div class=\"adL\">\n" +
-                "\n" +
-                "</div></div>";
-    }
 }
