There is a program that allows the user to enter and add products. When registering, a link is sent to activate the profile. This email looks like this!
photo from email - a
How can I add a photo of this link? If so send something to me is not beautiful :). I want to make it look like this:
Desired result
There is a code that allows you to send this link:
@RequestMapping(value = "/register", method = RequestMethod.POST) public String register(@ModelAttribute("user") User user) { user.setPassword(passwordEncoder.encode(user.getPassword())); user.setUserType(UserType.USER); user.setToken(UUID.randomUUID().toString()); userRepository.save(user); String url = String.format("http://localhost:8080/verify?token=%s&email=%s", user.getToken(), user.getEmail()); String text = String.format("Dear %s Thank you, you have successfully registered to our EShop, Please visit by link in order to activate your profile. %s", user.getName(), url); emailServiceImpl.sendSimpleMessage(user.getEmail(), "Welcome", text); return "redirect:/loginPage"; } If you count from the bottom this code will be the 2nd 3rd and 4th
we have a class EmailServiceImpl in fact by email some message sends this class in it there is such a code
@Autowired public JavaMailSender emailSender; public void sendSimpleMessage( String to, String subject, String text) { SimpleMailMessage message = new SimpleMailMessage(); message.setTo(to); message.setSubject(subject); message.setText(text); emailSender.send(message); } }
From the beginning, I thought that SimpleMailMessage is such a method that can allow you to send a photo, but in fact there is no method in this class that allows you to send a photo. All code was processed in Spring

