This contact form has Sendgrid and heroku in place, fully working. Github repo here
I trying to find a way to get the value of all the form elements.
Then make them into a param and then post it all to the endpoint using axios.
I do I connect my Heroku form using axios?
I'm quite lost on this process, and I need some. directions here. Perhaps a hint.
JS
axios.post(/mails/users/sendVerificationMail, body, { params: { mail, firstname }}) .then(response => response.status) .catch(err => console.warn(err));
HTML
<form id="contact-form">
<div class="row required">
<label for="name">Name</label>
<input class="input" id="name" type="text" name="name" autocomplete="name" required>
</div>
<div class="row required">
<label for="surname">Surname</label>
<input class="input" id="surname" type="text" name="surname" autocomplete="surname" required>
</div>
<div class="row required">
<label for="email">Email</label>
<input class="input" id="email" type="email" name="email" autocapitalize="off" autocomplete="email" required>
</div>
<div class="row">
<label for="phone">Phone</label>
<input class="input" id="phone" type="text" name="phone" autocomplete="tel">
</div>
<div class="row">
<label for="role">Job Role</label>
<input class="input" id="role" type="text" name="role">
</div>
<div class="row">
<label for="message">Message</label>
<textarea class="textarea" id="message" name="message"></textarea>
</div>
<div class="buttons row">
<button class="btn primary" type="submit">Submit</button>
</div>
</form>