Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

163
Visualizações
How to send an email to a specific user using emailJS in reactJS

I want to send quotations to specific users that have made a shipment in my react website. I am using emailjs, but it doesn't seem to be working. I want a non server-side way to do this.

here is my code:

const {freight, creatorsEmail} = useLocation().state; //creatoresEmail is the email of the user i want to send the email to.

 function sendEmail(e){
    e.preventDefault()
    
     emailjs.sendForm(
         "xxxxx",
         "xxxxxx",
          creatorsEmail,
         "xxxxx"
     ).then((res) => {
         if(res){
             firebase.firestore().collection("Quotations").add({
                 costPrice:costPrice,
                 sellPrice:sellPrice,
                 creatorsEmail:creatorsEmail,
                 freight:freight
             }).then((result) => {
                 alert("Quotation Sent Successfully")
                 window.location.reload()
             }).catch((e) => {
                alert("An Error Occured, Quotation Cannot be Sent")
                console.log(e)
             })
         }
       
     }).catch((e) => {
         alert("There was a problem")
         console.log(e)
     })
  }

               <Button
                color="primary"
                variant="contained"
                onclick={sendEmail} // in here would this be a correct way of calling the function sendEmail(e)?
              >
                Send Quotation
              </Button>
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda