\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82
| Path : /var/www/html/veridatapostgres/VeridataWebsite-v1/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/veridatapostgres/VeridataWebsite-v1/routes.py |
from flask import render_template, request, flash, redirect, url_for, g
from app import app, db, mail
from flask_mail import Message
from flask_babel import gettext as _
from datetime import datetime
import os
@app.context_processor
def inject_year():
return {'current_year': datetime.utcnow().year}
@app.route('/')
def index():
return render_template('index.html')
@app.route('/about')
def about():
return render_template('about.html')
@app.route('/solutions')
def solutions():
return render_template('solutions.html')
@app.route('/services')
def services():
return render_template('services.html')
@app.route('/certificates')
def certificates():
return render_template('certificates.html')
@app.route('/contact', methods=['GET', 'POST'])
def contact():
if request.method == 'POST':
name = request.form.get('name')
email = request.form.get('email')
phone = request.form.get('phone')
message = request.form.get('message')
try:
# Send email notification
msg = Message(
'New Contact Form Submission',
sender=os.environ.get('MAIL_DEFAULT_SENDER'),
recipients=[os.environ.get('MAIL_DEFAULT_RECIPIENT')]
)
msg.body = f"""
Name: {name}
Email: {email}
Phone: {phone}
Message: {message}
"""
mail.send(msg)
flash(_('Your message has been sent successfully!'), 'success')
return redirect(url_for('contact'))
except Exception as e:
app.logger.error(f"Failed to send email: {str(e)}")
flash(_('An error occurred. Please try again.'), 'error')
return render_template('contact.html')