validate method

void validate()

Validate required data

Implementation

void validate() {
  if (to.isEmpty) {
    throw Exception('At least one recipient is required in "to"');
  }
  if (subject.isEmpty) {
    throw Exception('Subject cannot be empty');
  }
  if (view.isEmpty) {
    throw Exception('View path cannot be empty');
  }
}