Ejemplo n.º 1
0
def send_welcome_email(user, my_email):
    """
    Sends welcome message on user's email
    :param user:
    :param my_email:
    :return:
    """
    sg = sendgrid.SendGridClient(SENDGRID_USERNAME, SENDGRID_PASSWORD)
    message = Mail(to=my_email,
                   subject='Welcome',
                   html=render_to_string('accounts/welcome_email.html',
                                         {'user': user}),
                   from_email=DEFAULT_EMAIL)
    status, msg = sg.send(message)
Ejemplo n.º 2
0
assets = Environment()
assets.init_app(app)

assets_env = AssetsEnvironment(os.path.join(utilities._PROJECT_ROOT, 'static'),
                               '/static')

jinja_environment = jinja2.Environment(autoescape=True,
                                       loader=jinja2.FileSystemLoader(
                                           os.path.join(
                                               os.path.dirname(__file__),
                                               "../templates")),
                                       extensions=[AssetsExtension])
jinja_environment.assets_environment = assets_env

sg = sendgrid.SendGridClient(app.config['SENDGRID_USERNAME'],
                             app.config['SENDGRID_PASSWORD'],
                             raise_errors=True)

babel = Babel(app)

SESSION_HIGHLIGHTPOINT_KEY = 'gps_highlightpoint_created'

DICTIONARY = "Dictionary"
DICTCOLUMN1 = "MS_TAVLA"
DICTCOLUMN2 = "KOD"
DICTCOLUMN3 = "TEUR"
cbs_dict_files = {DICTIONARY: "Dictionary.csv"}
content_encoding = 'cp1255'

Compress(app)