sendSMS method

Future<String> sendSMS({
  1. required String from,
  2. required String to,
  3. required String text,
  4. required String smsSecretKey,
})

Implementation

Future<String> sendSMS({
  required String from,
  required String to,
  required String text,
  required String smsSecretKey,
})async{
  Map<String,dynamic> mySMS = {
    "Text" : text,
    "From" : from,
    "To" : to,
  };
  String response = await SexyAPI(
    url: "https://$apiKey:$secretKey@api.mailjet.com",
    path: "/$smsAPIversion/sms-send",
    parameters: {},
  ).post(
    headers: {
      "Content-Type" : "application/json",
      "Authorization" : "Bearer " + smsSecretKey,
    },
    body: jsonEncode(mySMS),
  );
  return response;
}