-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.pyu
36 lines (29 loc) · 1019 Bytes
/
app.pyu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# app.py
from flask import Flask
from flask_mail import Mail, Message
app = Flask(__name__)
# Configure Flask-Mail
app.config['MAIL_SERVER'] = 'smtp.example.com'
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USERNAME'] = '[email protected]'
app.config['MAIL_PASSWORD'] = 'your-password'
mail = Mail(app)
@app.route('/send-email')
def send_email():
msg = Message('Ciao!!Hello from Audioimpact.it team!!!',
sender='[email protected]',
recipients=['[email protected]'])
msg.body = 'This is a test email sent from a Flask web application!'
mail.send(msg)
return 'Email sent!'
if __name__ == '__main__':
app.run(debug=True)
@app.route('/gdpr-consent', methods=['POST'])
def gdpr_consent():
# Logic to handle user consent
return 'Consent recorded!'
@app.route('/gdpr-request-data', methods=['POST'])
def gdpr_request_data():
# Logic to handle data access requests
return 'Data request processed!'