Glint Template – Missing sendMail.php?

Hello,

Been scouring the forums but nobody else seem so to be having this issue… Can anyone copy/paste the sendMail.php file contents for me as I just bought it and the file came blank.

I am well versed in PhP, but hoping I won’t have to recode this on my own.’’

Any help would be appreciated and apologies for double posting in other forum category!

Hi there

Hope you are having a good day and thank you for your question :slight_smile:
Sorry but HTML templates are created and can be downloaded without sendmail.php files, such files, and functions must be added by the customers

Thanks!
Colorlib Support Team

Okay, that seems odd but okay.

I have managed to create a sendMail.php that will send the submission + send the user a confirmation email, see below:

<?php
    // SENDS EMAIL AFTER SUBMISSION 
    $name = $_POST['contactName'];
    $email = $_POST['contactEmail'];
    $message = $_POST['contactMessage'];
    $formcontent="From: $name \n Message: $message";
    $recipient = "*YOUR EMAIL ADDRESS HERE";
    $subject = "Contact Form Submission";
    $mailheader = "From: $email \r\n";
    mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");

    // SENDS EMAIL CONFIRMATION TO USER ABOUT EMAIL SENT 
    $confirmationSubject = "Thank you for submitting to *YOURWEBSITE*";
    $confirmationContent="Hey $name, \n Thanks for filling out my contact form. \n I am usually attached at the hip to my phone, so expect an email back from you shortly! \r\n Best, \n *YOURNAME*";
    mail($email, $confirmationSubject, $confirmationContent) or die("Error!");
    $msg = "OK";
?>

In the main.js file however I am unable to pass the variable that passes the success of the form submit. Any idea how or where to pass this? Currently the form does not fade out as it should in the main.js.

var clContactForm = function() {
        
        /* local validation */
        $('#contactForm').validate({
        
            /* submit via ajax */
            submitHandler: function(form) {
    
                var sLoader = $('.submit-loader');
    
                $.ajax({
    
                    type: "POST",
                    url: "inc/sendEmail.php",
                    data: $(form).serialize(),
                    beforeSend: function() { 
    
                        sLoader.slideDown("slow");
    
                    },
                    success: function(msg) {
    
                        // Message was sent
                        if (msg == 'OK') {
                            sLoader.slideUp("slow"); 
                            $('.message-warning').fadeOut();
                            $('#contactForm').fadeOut();
                            $('.message-success').fadeIn();
                        }
                        // There was an error
                        else {
                            sLoader.slideUp("slow"); 
                            $('.message-warning').html(msg);
                            $('.message-warning').slideDown("slow");
                        }
    
                    },
                    error: function() {
    
                        sLoader.slideUp("slow"); 
                        $('.message-warning').html("Something went wrong. Please try again.");
                        $('.message-warning').slideDown("slow");
    
                    }
    
                });
            }
    
        });
    };

Any help would be greatly appreciated. Cant find a way to pass the if (msg == 'OK')