sendEmail method

ACTION: send_email

Sends an email to the subject of the card using a path like this: https://api.planningcenteronline.com/people/v2/people/1/workflow_cards/1/send_email

data can be a JSON String, or JSON serializable Object that follows the JSON:API specifications. The PlanningCenterApiData helper class has been provided for just such a purpose.

Details: Pass in a subject and note.

Implementation

Future<PlanningCenterApiResponse> sendEmail(Object data) async {
  if (id == null) {
    return PlanningCenterApiError.messageOnly(
      'Actions must be called on items that already exist on the remote server',
    );
  }
  var url = '$apiEndpoint/send_email';
  return api.call(url, verb: 'post', data: data, apiVersion: apiVersion);
}