07 - Formcarry Contact Form

August 25, 2021

WARNING: This post is over a year old. Some of the information this contains may be outdated.

DISCLAIMER: Any 3rd-party services in these posts and in the config are only recommendations/suggestions. I am not affiliated with any of them.

Register on Formcarry.

Get your Formcarry ID, go to config.php and add your ID under the services key.

<?php

return [
    // ...
    'services' => [
        'formcarry' => 'XXXXXXXXXXXX',
    ],
    // ...
];

Go to source/_assets/js/contact.js and change fakeSend(contactForm) to send(contactForm) in the lines shown below.

e.preventDefault();
e.target.elements['submit'].disabled = true;

fakeSend(contactForm) // edit this line
    .then((response) => {
        notyf.success('Your message has been sent.');
        contactForm.reset();
    })

And finally, remove this line.

const fakeSend = () => new Promise((resolve) => setTimeout(resolve, 2000));

Comments are not enabled for this post.