class_docstr: Handle all alert dispatching for AWS SES
class_docstr_tok: ["Handle","all","alert","dispatching","for","AWS","SES"]
docstr: Create the body of the email
  
  Args:
      msg (MIMEMultipart): Email Object to contruct body
      body (str): the body is represented as a string
      body (dict): dictionary of message_type/message for the body (for use with HTML)
code: def _construct_body(msg, body):
      """Create the body of the email
  
      Args:
          msg (MIMEMultipart): Email Object to contruct body
          body (str): the body is represented as a string
          body (dict): dictionary of message_type/message for the body (for use with HTML)
      """
      if isinstance(body, str):
          # For use with string based body
          LOGGER.debug("body is a string of: %s", body)
  
          msg.attach(MIMEText(body))
      elif isinstance(body, dict):
          # For use with HTML body
          LOGGER.debug(
              "body is not a string, attaching body of: %s", body
          )
  
          textual_message = MIMEMultipart("alternative")
          for m_type, message in body.items():
              part = MIMEText(message, m_type)
              textual_message.attach(part)
          msg.attach(textual_message)
  
      return msg
  
imports: from abc import abstractmethod
  from collections import OrderedDict
  from email.mime.application import MIMEApplication
  from email.mime.multipart import MIMEMultipart
  from email.mime.text import MIMEText
  from datetime import datetime
  import json
  import uuid
  import backoff
  from botocore.exceptions import ClientError
  import boto3
  from streamalert.alert_processor.helpers import compose_alert, elide_string_middle
  from streamalert.alert_processor.outputs.output_base import OutputDispatcher, OutputProperty, StreamAlertOutput
  from streamalert.shared.backoff_handlers import backoff_handler, success_handler, giveup_handler
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 2 for calling the SESOutput obj's underlying member method code with example usage: obj._construct_body(msg, body) and returns: msg