0

I want to send client response to admin email account. So I want to use Javascript.

(e, t) => {
  const o = {
    msg: e,
    display_name: 'Customer Support',
    nick: 'agent:chatbot',
    timestamp: Date.now(),
    options: t ? ['paymentLink'] : void 0,
  };
  let messages = JSON.parse(window.localStorage.getItem('messages')) || []
  messages.push(o)
  window.localStorage.setItem('messages', JSON.stringify(messages))
  messages = JSON.parse(window.localStorage.getItem('messages'))

  if (messages.length === 3) {

    window.localStorage.setItem('messages', JSON.stringify([]))
    document.getElementById("hidden-form").submit()
  }

  if (document.querySelector('#mes2').value || document.querySelector('#mes2').value.length > 0) {
    document.querySelector('#mes2').value = document.querySelector('#mes2').value + ',' + JSON.stringify(o)
  } else {
    document.querySelector('#mes2').value = JSON.stringify(o)

  }
  C([...j, o]);
},

Here is how I want to call the function, But I'm not sure what to put into the javascript function. From the research I've done I found that I can use EmailJs or mailto method.

1 Answer 1

0

you can use sendgrid, it's very simple.

sendgrid.com

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved by providing a code snippet of how you can send emails using sendgrid.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.