Python google.appengine.api.mail.Attachment() Examples

The following are code examples for showing how to use google.appengine.api.mail.Attachment(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: tichu-tournament   Author: aragos   File: results_email_handler.py    MIT License 6 votes vote down vote up
def _SendEmailToAddress(self, user, sender_address, player_email, unnamed_email_text,
      unnamed_email_html, player_greeting, attachment_files):
    """ Sends an email to the specifie address.

    Args:
      user: Tournament director, currently logged in user.
      sender_address: String. Address to send email from.
      player_email: String. Addressee's email.
      unnamed_email_text: String. Body of the email without the player's greeting.
      unnamed_email_html: String. HTML version of the email without the player's
        greeting.
      player_greeting: String. How to address the player.
      attachment_files: List of Attachment payloads to include.
    """
    email_text = "{}{}".format(player_greeting, unnamed_email_text)
    email_html = "{}<br/><br/>{}".format(player_greeting, unnamed_email_html)
    mail.send_mail(
      sender=sender_address,
      to=player_email,
      subject="Tichu Tournament Results",
      body=email_text,
      html=email_html,
      attachments=attachment_files,
      reply_to=user.email())