The problem: Javascript function( which was premade by template) cleans the form data sent to me by php
The php code:
You haven't provided the data
argument for $.post
Try
var form = $('.contact-form');
form.submit(function () {'use strict',
var $this = $(this);
$.post($(this).attr('action'), $this.serialize(), function(data) {
$this.prev().text(data.message).fadeIn().delay(3000).fadeOut();
},'json');
return false;
});
References:
jQuery.post() Docs
jQuery.serialize() Docs