Esempio n. 1
0
  def AddBatchEntry(self, mail_message, mail_item_properties,
                    mail_labels):
    """Adds a message to the current batch that you later will submit.
    
    Deprecated, use AddMailEntry instead

    Args:
      mail_message: An RFC822 format email message.
      mail_item_properties: A list of Gmail properties to apply to the message.
      mail_labels: A list of labels to apply to the message.

    Returns:
      The length of the MailEntry representing the message.
    """
    deprecation("calling deprecated method AddBatchEntry")
    mail_entry = migration.BatchMailEntry()
    mail_entry.rfc822_msg = migration.Rfc822Msg(text=(base64.b64encode(
        mail_message)))
    mail_entry.rfc822_msg.encoding = 'base64'
    mail_entry.mail_item_property = [migration.MailItemProperty(value=x) for x in mail_item_properties]
    mail_entry.label = [migration.Label(label_name=x) for x in mail_labels]

    self.mail_batch.AddBatchEntry(mail_entry)

    return len(str(mail_entry))
Esempio n. 2
0
  def AddBatchEntry(self, mail_message, mail_item_properties,
                    mail_labels):
    """Add a message to the current batch that you later will submit.

    Args:
      mail_message: An RFC822 format email message.
      mail_item_properties: A list of Gmail properties to apply to the message.
      mail_labels: A list of labels to apply to the message.

    Returns:
      The length of the MailEntry representing the message.
    """
    mail_entry = migration.BatchMailEntry()
    mail_entry.rfc822_msg = migration.Rfc822Msg(text=(base64.b64encode(
        mail_message)))
    mail_entry.rfc822_msg.encoding = 'base64'
    mail_entry.mail_item_property = map(
        lambda x: migration.MailItemProperty(value=x), mail_item_properties)
    mail_entry.label = map(lambda x: migration.Label(label_name=x),
                           mail_labels)

    self.mail_batch.AddBatchEntry(mail_entry)

    return len(str(mail_entry))
Esempio n. 3
0
    def AddBatchEntry(self, mail_message, mail_item_properties,
                      mail_labels):
        """Adds a message to the current batch that you later will submit.

        Deprecated, use AddMailEntry instead

        Args:
          mail_message: An RFC822 format email message.
          mail_item_properties: A list of Gmail properties to apply to the message.
          mail_labels: A list of labels to apply to the message.

        Returns:
          The length of the MailEntry representing the message.
        """
        deprecation("calling deprecated method AddBatchEntry")
        mail_entry = migration.BatchMailEntry()
        mail_entry.rfc822_msg = migration.Rfc822Msg(text=(base64.b64encode(
            mail_message)))
        mail_entry.rfc822_msg.encoding = 'base64'
        mail_entry.mail_item_property = [migration.MailItemProperty(value=x) for x in mail_item_properties]
        mail_entry.label = [migration.Label(label_name=x) for x in mail_labels]

        self.mail_batch.AddBatchEntry(mail_entry)

        return len(str(mail_entry))

    def SubmitBatch(self, user_name):
        """Sends all the mail items you have added to the batch to the server.

        Deprecated, use ImportMultipleMails instead