Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue # 78 | Feature: Add Email Contact Form Function for Java #235

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

PalaniappanC
Copy link

(#78)

What does this PR do?

Add Email Contact Form Function for Java

Test Plan

video1595354462.mp4

@PalaniappanC
Copy link
Author

Hi folks, I attempted to include HTML files in a separate static folder, but encountered issues accessing them. After seeking advice on the Discord channel, I learned that due to Java being a compiled language, it cannot directly include static and resource files. However, I made an effort to address this by copying the files to the 'src/main/resources' folder within OpenRuntimes, as per Steven's suggestion. Unfortunately, I encountered challenges while doing this. As a workaround, I have added the html content as constant strings.

@loks0n loks0n self-requested a review October 23, 2023 13:35
Copy link
Member

@loks0n loks0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR - left some comments

java/email-contact-form/README.md Outdated Show resolved Hide resolved
java/email-contact-form/src/Cors.java Outdated Show resolved Hide resolved
java/email-contact-form/src/Cors.java Outdated Show resolved Hide resolved
java/email-contact-form/src/Cors.java Outdated Show resolved Hide resolved
java/email-contact-form/src/Cors.java Outdated Show resolved Hide resolved
java/email-contact-form/src/Utils.java Outdated Show resolved Hide resolved
java/email-contact-form/src/Main.java Outdated Show resolved Hide resolved
java/email-contact-form/src/Main.java Outdated Show resolved Hide resolved
java/email-contact-form/src/Main.java Outdated Show resolved Hide resolved
java/email-contact-form/src/Main.java Outdated Show resolved Hide resolved
- Remove unwanted imports
_ Remove unwanted error code variable declaration & have it inline
- Refactor javadoc style comments
- Access Origin headers with lowercase "origin"
@PalaniappanC
Copy link
Author

Hi @loks0n Thank you so much for taking time to review my PR. I have pushed the recommended changes.

@loks0n
Copy link
Member

loks0n commented Oct 30, 2023

I've added hacktoberfest-accepted we can merge it when the Java runtime has static folder support

@loks0n loks0n self-requested a review October 30, 2023 10:02
@PalaniappanC
Copy link
Author

Thanks @loks0n

@tessamero tessamero linked an issue Nov 2, 2023 that may be closed by this pull request
6 tasks
@PalaniappanC
Copy link
Author

Dicord Name for Hacktoberfest communications : palani_13


public class Utils {

static String INDEX_HTML = "<!doctype html><html lang=\"en\"><head><meta charset=\"UTF-8\" /><meta http-equiv=\"X-UA-Compatible\" content=\"IE\" /><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /><title>Email Contact Form</title><link rel=\"stylesheet\" href=\"https://unpkg.com/@appwrite.io/pink\" /><link rel=\"stylesheet\" href=\"https://unpkg.com/@appwrite.io/pink-icons\" /></head><body><main class=\"main-content\"><div class=\"top-cover u-padding-block-end-56\"><div class=\"container\"><div class=\"u-flex u-gap-16 u-flex-justify-center u-margin-block-start-16\"><h1 class=\"heading-level-1\">Contact</h1><code class=\"u-un-break-text\"></code></div><p class=\"body-text-1 u-normal u-margin-block-start-16\" style=\"max-width: 50rem\">Fill the form below to send us a message.</p><form class=\"u-flex-vertical u-gap-16 u-margin-block-start-16\" style=\"max-width: 50rem\" method=\"post\"><input type=\"email\" name=\"email\" placeholder=\"Email\" required /><textarea name=\"message\" placeholder=\"Your Message\" required></textarea><button class=\"button\" type=\"submit\">Submit</button></form></div></div></main></body></html>";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're going to hold off merging this PR until we have a better solution for this on Open Runtimes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀 Feature: Add Email Contact Form Function for Java
3 participants