original_docstring: Sends an email for the week asking if members want a meeting
docstring: Sends an email for the week asking if members want a meeting
docstring_tokens: Sends an email for the week asking if members want a meeting
code: def send_batch_weekly_opt_in_email(meeting_spec):
      """Sends an email for the week asking if members want a meeting"""
      load_secrets()
      create_url = 'https://{}.appspot.com/meeting_request/{}'.format(
          secrets["PROJECT"],
          meeting_spec.id
      )
      logging.info('created url ' + create_url)
  
      users = get_users_from_spec(meeting_spec)
      users = [user for user in users if user]
  
      logging.info(len(users))
      logging.info(meeting_spec)
      meeting_datetime = get_meeting_datetime(meeting_spec)
      subscription = meeting_spec.meeting_subscription
      logging.info(meeting_datetime.strftime('%I:%M %p %Z'))
  
      for user in users:
          if not user.terminated:
              logging.info(user)
              logging.info(meeting_datetime)
              send_single_email(
                  user.email,
                  "Want a beans meeting this week?",
                  "weekly_opt_in_email.html",
                  {
                      'first_name': user.first_name,
                      'office': subscription.office,
                      'location': subscription.location,
                      'meeting_day': meeting_datetime.strftime('%A'),
                      'meeting_time': meeting_datetime.strftime('%I:%M %p %Z'),
                      'meeting_url': create_url,
                      'link_to_change_pref': 'https://{}.appspot.com/'.format(secrets["PROJECT"]),
                      'project': secrets["PROJECT"]
                  }
              )
              logging.info('sent email')
          else:
              logging.info(user)
              logging.info('terminated')
code_tokens: def send_batch_weekly_opt_in_email ( meeting_spec ) : load_secrets ( ) create_url = 'https://{}.appspot.com/meeting_request/{}' . format ( secrets [ "PROJECT" ] , meeting_spec . id ) logging . info ( 'created url ' + create_url ) users = get_users_from_spec ( meeting_spec ) users = [ user for user in users if user ] logging . info ( len ( users ) ) logging . info ( meeting_spec ) meeting_datetime = get_meeting_datetime ( meeting_spec ) subscription = meeting_spec . meeting_subscription logging . info ( meeting_datetime . strftime ( '%I:%M %p %Z' ) ) for user in users : if not user . terminated : logging . info ( user ) logging . info ( meeting_datetime ) send_single_email ( user . email , "Want a beans meeting this week?" , "weekly_opt_in_email.html" , { 'first_name' : user . first_name , 'office' : subscription . office , 'location' : subscription . location , 'meeting_day' : meeting_datetime . strftime ( '%A' ) , 'meeting_time' : meeting_datetime . strftime ( '%I:%M %p %Z' ) , 'meeting_url' : create_url , 'link_to_change_pref' : 'https://{}.appspot.com/' . format ( secrets [ "PROJECT" ] ) , 'project' : secrets [ "PROJECT" ] } ) logging . info ( 'sent email' ) else : logging . info ( user ) logging . info ( 'terminated' )
short_docstring: Sends an email for the week asking if members want a meeting
short_docstring_tokens: Sends an email for the week asking if members want a meeting
comment: """Sends an email for the week asking if members want a meeting"""