phisoft / phisoft-web

Company main website.
2 stars 0 forks source link

update contact form #220

Closed rosclaritha closed 6 months ago

rosclaritha commented 6 months ago

READ & WATCH BELOW FOR BETTER UNDERSTANDING PR Reference https://github.com/phisoft/atongroup-web/pull/497/commits/4c936fabceeab00444c9e4938dcccc4775739295 Video Reference: https://www.youtube.com/watch?v=yP85ECOVMe8


Follow the steps:

  1. Register phisoft.marketing@gmail.com to https://elasticemail.com/select-product select email api image

For below, refer video: https://www.youtube.com/watch?v=yP85ECOVMe8

  1. Once success register, in elasticemail, verify email phisoft.marketing@gmail.com

  2. You will need to verify link in email

  3. Once done, it will be displayed in page Verification as of below: image

  4. Setup SMTP in settings

    • For new one, you need to Create SMTP Credentials
    • Your username, password will be generated. Copy / Paste to be put in the code image
  5. Successful SMTP registration will have something like this: image

  6. Update the code for the form. Refer PR: https://github.com/phisoft/atongroup-web/pull/497/commits/4c936fabceeab00444c9e4938dcccc4775739295

HTML Form image

-- the form id, needs to be the as in the script for successful email and correct data.

Script image

                  Host  : "smtp.elasticemail.com", //same
                  Username : "appx.noreply@gmail.com", 
                  Password : "7D57893CB377F2430F1E41B62C9EF8CC3201",
                  To  : 'rosclaritha@gmail.com', //email submission recipient ==> hello@phisoft.my
                  From  : "appx.noreply@gmail.com",
  1. If success, you should be able to receive the email in your receiver email => hello@phisoft.my

[FULL CODE] REFERENCE ONLY

[SCRIPT]

<script src="https://smtpjs.com/v3/smtp.js"></script>
<script>
              function sendEmail(){
                Email.send({
                  Host  : "smtp.elasticemail.com",
                  Username : "appx.noreply@gmail.com",
                  Password : "7D57893CB377F2430F1E41B62C9EF8CC3201",
                  To  : 'rosclaritha@gmail.com',
                  From  : "appx.noreply@gmail.com",
                  Subject : "Aton Website Contact Form Submission",
                  Body  : "Name: " + document.getElementById("name").value
                        + "<br> Phone Number: " + document.getElementById("phone").value
                        + "<br> Email: " + document.getElementById("email").value
                        + "<br> Message: " + document.getElementById("message").value

                }).then(
                  message => alert("Message successfully sent.")
                );
              }
</script>
eleysaemily commented 6 months ago