What-
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package be.naaturel.boardmateapi.controllers;
|
||||
|
||||
import be.naaturel.boardmateapi.common.helpers.Logger;
|
||||
import be.naaturel.boardmateapi.services.SendgridService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -26,6 +27,7 @@ public class EmailController {
|
||||
@PostMapping("/mail/send")
|
||||
public ResponseEntity<String> send(@RequestBody String payload){
|
||||
try {
|
||||
Logger.displayInfo(payload);
|
||||
service.send("laurent0206.cr@gmail.com", "Hello from board mate !", payload);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package be.naaturel.boardmateapi.controllers;
|
||||
|
||||
import be.naaturel.boardmateapi.common.helpers.Logger;
|
||||
import be.naaturel.boardmateapi.services.TwilioService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -24,6 +25,7 @@ public class SmsController {
|
||||
@PostMapping("/sms/send")
|
||||
public ResponseEntity<String> example(@RequestBody String text){
|
||||
try {
|
||||
Logger.displayInfo(text);
|
||||
service.send(text);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package be.naaturel.boardmateapi.services;
|
||||
|
||||
import be.naaturel.boardmateapi.common.exceptions.ServiceException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import be.naaturel.boardmateapi.common.helpers.Logger;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.twilio.rest.api.v2010.account.Message;
|
||||
@@ -10,8 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class TwilioService {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user