PLEASE WORK FOR FUCKS SAKE
This commit is contained in:
@@ -2,6 +2,8 @@ package be.naaturel.boardmateapi.controllers;
|
||||
|
||||
import be.naaturel.boardmateapi.common.helpers.Logger;
|
||||
import be.naaturel.boardmateapi.services.SendgridService;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -25,9 +27,11 @@ public class EmailController {
|
||||
}
|
||||
|
||||
@PostMapping("/mail/send")
|
||||
public ResponseEntity<String> send(@RequestBody Map<String, Object> payload){
|
||||
public ResponseEntity<String> send(@RequestBody String payload){
|
||||
try {
|
||||
service.send("laurent0206.cr@gmail.com", "Hello from board mate !", payload);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Map<String, Object> map = mapper.readValue(payload, new TypeReference<>() {});
|
||||
service.send("laurent0206.cr@gmail.com", "Hello from board mate !", map);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user