from flask import Flask, request, render_template_string import requests import json app = Flask(__name__) # HTML 템플릿 HTML_TEMPLATE = ''' 이메일 전송

이메일 웹훅 전송

{% if result %}

{{ result }}

{% endif %} ''' @app.route('/', methods=['GET', 'POST']) def home(): result = None if request.method == 'POST': email = request.form['email'] webhook_url = "https://connect.pabbly.com/workflow/sendwebhookdata/IjU3NjYwNTZmMDYzMDA0M2M1MjZiNTUzMzUxMzUi_pc" try: response = requests.post(webhook_url, json={"email": email}) if response.status_code == 200: try: result = f"성공!\n{json.dumps(response.json(), indent=2, ensure_ascii=False)}" except: result = f"성공!\n{response.text}" else: result = f"오류: {response.status_code}\n{response.text}" except Exception as e: result = f"오류 발생: {str(e)}" return render_template_string(HTML_TEMPLATE, result=result) if __name__ == '__main__': app.run(debug=True, port=7860)