modif route controller mail

This commit is contained in:
Hedi 2022-01-28 12:08:49 +01:00
parent b47c3fdf6d
commit f23b0fbb87
2 changed files with 3 additions and 3 deletions

View file

@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.mail.MessagingException; import javax.mail.MessagingException;
@RestController @RestController
@RequestMapping("/mail") @RequestMapping("/sendmail")
public class MailController { public class MailController {
SendMailService service; SendMailService service;
@ -20,7 +20,7 @@ public class MailController {
this.service = service; this.service = service;
} }
@PostMapping("/send") @PostMapping("/text")
public ResponseEntity<String> sendMail(@RequestBody Mail mail) { public ResponseEntity<String> sendMail(@RequestBody Mail mail) {
service.sendMail(mail); service.sendMail(mail);
return new ResponseEntity<>("Email Sent successfully", HttpStatus.OK); return new ResponseEntity<>("Email Sent successfully", HttpStatus.OK);

View file

@ -41,7 +41,7 @@ public class SendMailServiceImpl implements SendMailService {
helper.setSubject(mail.getSubject()); helper.setSubject(mail.getSubject());
String htmlMsg = "<h3>Im testing send a HTML email</h3>" String htmlMsg = "<h3>Test d'envoi de mail au format HTML</h3>"
+"<img src='http://www.apache.org/images/asf_logo_wide.gif'>"; +"<img src='http://www.apache.org/images/asf_logo_wide.gif'>";
msg.setContent(htmlMsg, "text/html"); msg.setContent(htmlMsg, "text/html");