def to(self, to_emails, global_substitutions=None, is_multiple=False, p=0):
        """Adds To objects to the Personalization object

        :param to_emails: An To or list of To objects
        :type to_emails: To, list(To), str, tuple
        :param global_substitutions: A dict of substitutions for all recipients
        :type global_substitutions: dict
        :param is_multiple: Create a new personilization for each recipient
        :type is_multiple: bool
        :param p: p is the Personalization object or Personalization object
                  index
        :type p: Personalization, integer, optional
        """
        if isinstance(to_emails, list):
            for email in to_emails:
                if isinstance(email, str):
                    email = To(email, None)
                if isinstance(email, tuple):
                    email = To(email[0], email[1])
                self.add_to(email, global_substitutions, is_multiple, p)
        else:
            if isinstance(to_emails, str):
                to_emails = To(to_emails, None)
            if isinstance(to_emails, tuple):
                to_emails = To(to_emails[0], to_emails[1])
            self.add_to(to_emails, global_substitutions, is_multiple, p)
def to ( self , to_emails , global_substitutions = None , is_multiple = False , p = 0 ) : if isinstance ( to_emails , list ) : for email in to_emails : if isinstance ( email , str ) : email = To ( email , None ) if isinstance ( email , tuple ) : email = To ( email [ 0 ] , email [ 1 ] ) self . add_to ( email , global_substitutions , is_multiple , p ) else : if isinstance ( to_emails , str ) : to_emails = To ( to_emails , None ) if isinstance ( to_emails , tuple ) : to_emails = To ( to_emails [ 0 ] , to_emails [ 1 ] ) self . add_to ( to_emails , global_substitutions , is_multiple , p )
Adds To objects to the Personalization object

        :param to_emails: An To or list of To objects
        :type to_emails: To, list(To), str, tuple
        :param global_substitutions: A dict of substitutions for all recipients
        :type global_substitutions: dict
        :param is_multiple: Create a new personilization for each recipient
        :type is_multiple: bool
        :param p: p is the Personalization object or Personalization object
                  index
        :type p: Personalization, integer, optional