Directory of RSS feeds
Statistics

RSS feeds in the directory: 2819

Added today: 0

Added yesterday: 0

Hi-Tech / Other

"Call me back" with the receipt of SMS alert

Typical Internet guy ™ 20.03.2018 at 08:07

Vyacheslav Scoble: about creativity, about life and other nonsense, giving advice: how to live on the Internet, how to survive and what to do with all this

In the article "How to do "Request a call back" for WordPress with your own hands" we considered some variants of the build in WP Windows forms CF7 for fast ordering call. And in the article "All the secrets of Contact Form 7 plugin" addressed some of the advanced features such a popular plugin. In this article we will make some symbiosis of these two publications and make themselves (with their hands) good-looking shape called "Call me" or "Request a call back" with some special features.

it will Look as follows:

C appearance it is a normal feedback form implemented using the plugin CF7, containing two fields - Name and phone Number. But in contrast to the standard form, this will be two features:

the Field "phone Number" will be validated for compliance with the phone; After you submit the form from the site, the site administrator will receive a notification SMS is lightning fast (the contents of the forms immediately sent via SMS with duplication by e-mail);

this form of callback request clear advantage. And also two:

Antispam (probability that you will roll in fake applications on a call is very low); the Operator receiving the request for a call back, can respond at lightning speed;

Where and why use such forms? Where do you give Your website visitors the ability to contact You if he has any question or problem, if You do not want to "Shine" their phones, etc. These forms are on large Internet sites (where the actual connected call centers), and small Internet sites that sell different stuff or offering a variety of services.

is Usually "Request a call" the visitor sees in the header (first screen). This position is ideal for permanent audience of the website or online store. If You have an information site and people come to him with the search then it will be perfect to place a form at the bottom of the publish/news/articles so that a user will Balk at this tempting offer after reviewing the material. To title this form can be intriguing:

call You back? Didn't find the answer to your question? Not found what you were looking for? You have questions? Requires the assistance of a consultant? Create a form CF7

Contact Form 7 - Add new. In the form template insert:

[text* your-name maxlength:22 placeholder "Your name"]

Phone

[text* your-tel class:tel placeholder "+7 (___) ___-__-__"]

[submit "get Back to me, please."]

In file single.php, page.php template (if we're talking about inserting the form in the end of this publication) in the right place to insert the code (don't forget to correct contact-form-7 shortcode on shortcode their contact form):

didn't find what you were looking for?

request a call back! *

* In 97% of cases we call back within 5 minutes!

the style.plug-in css styles (do not forget to correct by itself):

.action-callback.call {

border-radius: 5px;

background: #2b8c2a;

border: 1px ridge #2b8c2a;

background-repeat: no-repeat;

background-size: cover;

height: 240px;

color: #fff;

} Pluggable validation phone number

somewhere in footer.php (to avoid conflicts) in your current theme (file jquery.maskedinput.min.js you can transfer to your server):

On this validation of the phone number in CF7 is over!

Connected SMS informing

First of all, we need to register in the service, which will send us an SMS. Recommend https://seozona.sms.ru (follow the link for registration).

For SMS have to pay, but 10 SMS per day due to the service, so if You do not go over this limit, and can use SMS-informing is absolutely free. In case the fire, the balance can be replenished by an arbitrary amount.

After the registration in "my account" in the menu find "Programmers", in this tab you will find Your api_id. You will need it. You also need to include your phone number that will receive SMS in the code below, which insert into the file functions.php current theme:

add_action( 'wpcf7_mail_sent', 'your_wpcf7_mail_sent_function' );

your_wpcf7_mail_sent_function function( $contact_form ) {

$title = $contact_form->title;

$posted_data = $contact_form->posted_data;

if ('Custom ringer' == $title ) {

$submission = WPCF7_Submission::get_instance();

$posted_data = $submission->get_posted_data();

$yourphone = $posted_data['your-tel'];

$yourname = $posted_data['your-name'];

$mes = 'dial:'.$yourphone.' '.$yourname;

$sms = str_replace(' ','+', $mes);

$url2="http://sms.ru/sms/send?api_id=Y231AC10-0F1B-8AE2-1622-478C2FAC61F1&to=794512345678&text;=$sms";

$body=file_get_contents($url2);

}}

that's it! Thank you for your attention! The difficulties encountered in the process of building this form of debate in the comments!