File size: 1,828 Bytes
5aaeeb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import streamlit as st

# Function to simulate sending an email
def send_email(tool, email):
    # Here you can add your email sending logic
    # For now, we'll just print the details to the console
    st.write(f"Tool: {tool}")
    st.write(f"Email: {email}")
    st.success("Your request has been sent successfully!")
    
    # Store the tool and email in session state
    st.session_state['tool'] = tool
    st.session_state['email'] = email
    st.session_state['page'] = 'mail'

# Function for the tool request form page
def tool_request_page():
    st.title("Tool Request Form")

    # Input fields
    tool = st.text_input("Tool Name", placeholder="Enter the tool you need")
    email = st.text_input("Your Email", placeholder="Enter your email address")

    # Send button
    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.")

# Function for the email confirmation page
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:")
    
    # Retrieve the tool and email from session state
    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.")

# Main function to handle page navigation
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()