generateJsonBody method

Future<Map<String, dynamic>> generateJsonBody(
  1. Iterable<PhoneNumber> to,
  2. Message message
)

Generate the JSON body for the request.

Implementation

Future<Map<String, dynamic>> generateJsonBody(
    Iterable<PhoneNumber> to, Message message) async {
  return {
    ...await message.toData(this),
    'PhoneNumberSet': to.map((e) => generatePhoneNumber(e)).toList(),
    'SmsSdkAppId': appId,
    'TemplateId': await message.toTemplate(this)
  };
}