send method Null safety
Sends message
Requires;
message (message to be send)
to (a list of recipient's phone numbers)
when from is provided, it will override shortCode
Implementation
Future<http.Response> send({
required String message,
required List<String>to,
String? from,
// optionals
int? bulkSMSMode, int? enqueue, String? keyword, String? linkId, int? retryDurationInHours
})async{
return await africasTalking.httpPostProcess(
africasTalking.isLive ? smsLiveUrl : smsTestUrl,
{
'from': (from ?? shortCode).toString(),
'to': to.join(','),
'message': message,
if(bulkSMSMode != null) ...{'bulkSMSMode': bulkSMSMode},
if(enqueue != null) ...{'enqueue': enqueue},
if(keyword != null) ...{'keyword': keyword},
if(linkId != null) ...{'linkId': linkId},
if(retryDurationInHours != null) ...{'retryDurationInHours': retryDurationInHours},
}
);
}