|
import streamlit as st |
|
|
|
|
|
def send_email(tool, email): |
|
|
|
|
|
st.write(f"Tool: {tool}") |
|
st.write(f"Email: {email}") |
|
st.success("Your request has been sent successfully!") |
|
|
|
|
|
st.session_state['tool'] = tool |
|
st.session_state['email'] = email |
|
st.session_state['page'] = 'mail' |
|
|
|
|
|
def tool_request_page(): |
|
st.title("Tool Request Form") |
|
|
|
|
|
tool = st.text_input("Tool Name", placeholder="Enter the tool you need") |
|
email = st.text_input("Your Email", placeholder="Enter your email address") |
|
|
|
|
|
if st.button("Send"): |
|
if tool and email: |
|
send_email(tool, email) |
|
else: |
|
st.error("Please fill in both the tool name and your email address.") |
|
|
|
|
|
def mail_page(): |
|
st.title("Email Sent Successfully") |
|
st.write("Thank you for your tool request! Your email has been sent.") |
|
st.write("Here are the details of your request:") |
|
|
|
|
|
tool = st.session_state.get('tool') |
|
email = st.session_state.get('email') |
|
|
|
if tool and email: |
|
st.write(f"**Tool:** {tool}") |
|
st.write(f"**Email:** {email}") |
|
else: |
|
st.write("No request details found.") |
|
|
|
|
|
def main(): |
|
if 'page' not in st.session_state: |
|
st.session_state['page'] = 'tool_request' |
|
|
|
if st.session_state['page'] == 'tool_request': |
|
tool_request_page() |
|
elif st.session_state['page'] == 'mail': |
|
mail_page() |
|
|
|
if __name__ == "__main__": |
|
main() |