Do you want to have a contact form in your website so that the visitors directly can write you a message onsite? In order to stay in touch with your visitors, it can be a good idea.
First, create a text. Then on your right, you can write as below.
<form id="mailform">
<label class="label" for="name">Your Name</label>
<input class="input" type="text" name="name" data-name="Name" required="required">
<label class="label" for="email">Your Email</label>
<input class="input" type="text" name="email" data-name="Email" required="required">
<input name="subject" type="hidden" value="Message from webpgr.com"> <label class="label" for="email">Message</label>
<textarea name="body" class="textarea" rows="6"></textarea><br>
<input class="btn" type="submit" value="Submit" data-wait="Please wait..."></form>Then it will look this instantly.
Then go on the Hacker shell by Ctrl + m, then on the JS tap, insert as below.
$('#view').on('submit', '#mailform', function(e) {
e.preventDefault();
$.ajax({ url: localconfig.baseurl + "/email/send/" + app.this_page.id,
data: $(this).serialize(),
type: 'POST',
success: function(e) {
$.jGrowl('Mail successfully sent!');
ga('send', 'event', 'conversion', 'submit', 'mail');
},
error: function(jqXHR, textStatus, errorThrown) {
if (app.this_user.id !== app.this_page.ownr) {
$.jGrowl('Failed sending mail :\'(', {
theme: 'jGrowlError'
});
} else {
$.jGrowl('Failed sending mail: ' + jqXHR.responseText, {
theme: 'jGrowlError'
});
}
}
});
});
Finally go to Page configuration then fill in your email. Save and exit. Done.
Now you will get emails to your email address.
<form id="mailform">
<label class="label" for="name">Your Name</label>
<input class="input wp-textinput" type="text" name="name" data-name="Name" required="required">
<label class="label" for="email">Your Email</label>
<input class="input wp-textinput" type="text" name="email" data-name="Email" required="required"> <input name="subject" type="hidden" value="Message from webpgr.com">
<label class="label" for="email">Message</label>
<textarea name="body" class="textarea wp-textinput" rows="6"></textarea><br>
<input class="btn" type="submit" value="Submit" data-wait="Please wait...">
</form>width: 250px;