我理解使用Python通过Mailgun API发送消息的基本知识以及来自我网站的请求,并且一切正常 . 我想使用request.forms.get('')附加HTML表单中的数据,但无法找出使其工作的语法 . 下面的链接正是我需要做的,除了Python而不是PHP .
如何通过Mailgun发送以下表单数据?
HTML FORM (Parts of it to get the point across)
...
...
ROUTE (Parts of it to get the point across)
@route('/send', method='POST')
def send_simple_message():
variable_I_need_to_send = request.forms.get('firstname')
...
data={...",
"to": "MyName ",
"subject": "Website Info Request",
"text": "Testing some Mailgun awesomness!",
"html": **variable_I_need_to_send**})
return '''
谢谢