im getting this error i searched on the same issues like mine on stack and i have foudn that i shouldn t put .html when calling it but im getting the same error :
`Caused by: org.thymeleaf.exceptions.TemplateInputException: Error resolving template "orderConfirmationEmailTemplate", template might not exist or might not be accessible by any of the configured Template Resolver`s my mail constructor :
@Component public class MailConstructor { @Autowired private Environment env; @Autowired private TemplateEngine templateEngine; public SimpleMailMessage constructNewUserEmail(User user, String password) { String message="\nPlease use the following credentials to log in and edit your personal information including your own password." + "\nUsername:"+user.getUsername()+"\nPassword:"+password; SimpleMailMessage email = new SimpleMailMessage(); email.setTo(user.getEmail()); email.setSubject("Le's Bookstore - New User"); email.setText(message); email.setFrom(env.getProperty("support.email")); return email; } public MimeMessagePreparator constructOrderConfirmationEmail (User user, Order order, Locale locale) { Context context = new Context(); context.setVariable("order", order); context.setVariable("user", user); context.setVariable("cartItemList", order.getCartItemList()); String text = templateEngine.process("orderConfirmationEmailTemplate.html", context); MimeMessagePreparator messagePreparator = new MimeMessagePreparator() { @Override public void prepare(MimeMessage mimeMessage) throws Exception { MimeMessageHelper email = new MimeMessageHelper(mimeMessage); email.setTo(user.getEmail()); email.setSubject("Order Confirmation - "+order.getId()); email.setText(text,true); email.setFrom(new InternetAddress("[email protected]")); } }; return messagePreparator; } and im calling it from rest service:
mailSender.send(mailConstructor.constructOrderConfirmationEmail(user, order, Locale.ENGLISH)); shoppingCartService.clearShoppingCart(shoppingCart); and im putting the file .html under package in the project

