<commit_before>from datetime import date

from flask import Flask, jsonify, render_template, request
from logzero import logger

# importing like this allows mocking e.g. sheet.<name>
from dojo_emailer import emailer, sheet
from dojo_emailer.scheduler import is_reminder_day
from dojo_emailer.sessions import get_first_of_next_month

# email settings
FROM_ADDRESS = 'Dojo monthly reminder <<EMAIL>>'
TO_ADDRESS = FROM_ADDRESS
SUBJECT = 'Monthly dojo reminder for {0:%B} {0:%Y}'
TEMPLATE_FILENAME = 'reminder_template.html'

# google spreadsheet settings
SPREADSHEET_NAME = "Dojo sessions"
SPREADSHEET_URL = 'https://docs.google.com/spreadsheets/d/{id}'
# to keep the url of our google doc private, we read it from this sheet
GDOCS_URL_SHEET_NAME = 'Eventbrite Steps'
GDOCS_URL_PREFIX = 'https://docs.google.com/document'

app = Flask(__name__)


@app.route('/')
def send_email_endpoint():
    """Sends a reminder email if today is a reminder day.<commit_msg>Send from a fresh address. Fixes #2<commit_after>from datetime import date

from flask import Flask, jsonify, render_template, request
from logzero import logger

# importing like this allows mocking e.g. sheet.<name>
from dojo_emailer import emailer, sheet
from dojo_emailer.scheduler import is_reminder_day
from dojo_emailer.sessions import get_first_of_next_month

# email settings
FROM_ADDRESS = 'Dojo monthly reminder <<EMAIL>>'
TO_ADDRESS = 'Dojo discuss <<EMAIL>>'
TO_ADDRESS = FROM_ADDRESS
SUBJECT = 'Monthly dojo reminder for {0:%B} {0:%Y}'
TEMPLATE_FILENAME = 'reminder_template.html'

# google spreadsheet settings
SPREADSHEET_NAME = "Dojo sessions"
SPREADSHEET_URL = 'https://docs.google.com/spreadsheets/d/{id}'
# to keep the url of our google doc private, we read it from this sheet
GDOCS_URL_SHEET_NAME = 'Eventbrite Steps'
GDOCS_URL_PREFIX = 'https://docs.google.com/document'

app = Flask(__name__)


@app.route('/')
def send_email_endpoint():
    """Sends a reminder email if today is a reminder day.
{'fraction_non_alphanumeric': 0.09261133603238866, 'fraction_numerical': 0.0025303643724696357, 'mean_word_length': 5.747440273037543, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5352752', 'n_tokens_mistral': 653, 'n_tokens_neox': 640, 'n_words': 201}