setupRawMessageText method

String setupRawMessageText(
  1. Report report
)

Setup raw text email message from report.

Implementation

String setupRawMessageText(Report report) {
  final StringBuffer buffer = StringBuffer();
  if (emailHeader?.isNotEmpty == true) {
    buffer.write(emailHeader);
    buffer.write("\n\n");
  }

  buffer.write("Error:\n");
  buffer.write(report.error.toString());
  buffer.write("\n\n");
  if (enableStackTrace) {
    buffer.write("Stack trace:\n");
    buffer.write(report.stackTrace.toString());
    buffer.write("\n\n");
  }
  if (enableDeviceParameters) {
    buffer.write("Device parameters:\n");
    for (final entry in report.deviceParameters.entries) {
      buffer.write("${entry.key}: ${entry.value}\n");
    }
    buffer.write("\n\n");
  }
  if (enableApplicationParameters) {
    buffer.write("Application parameters:\n");
    for (final entry in report.applicationParameters.entries) {
      buffer.write("${entry.key}: ${entry.value}\n");
    }
    buffer.write("\n\n");
  }
  if (enableCustomParameters) {
    buffer.write("Custom parameters:\n");
    for (final entry in report.customParameters.entries) {
      buffer.write("${entry.key}: ${entry.value}\n");
    }
    buffer.write("\n\n");
  }
  return buffer.toString();
}