Hot answers tagged

8 votes
Accepted

How can I send to multiple Contact Form 7 recipients based on form input?

No need to write any code, Contact form 7 has features of Additional Headers in the Mail section. In that you just need to write the email's header inside the Additional headers textbox in Mail(Second ...
user avatar
  • 1,296
7 votes

How to get current url in contact form 7

See this example on how to create and parse the shortcode in the contact form 7 to use it add [current_url] add_action( 'wpcf7_init', 'wpcf7_add_form_tag_current_url' ); function ...
user avatar
  • 1,723
6 votes

Removing "Website" Field from the contact info

I resolved the problem with ob_ functions and DOMDocument. It's better than jQuery or CSS for protecting the form. I use this kind of solution every time when I can't access a part of HTML content ...
user avatar
3 votes

How to get current url in contact form 7

according to Contact Form 7 documentation you need this: [_url] — This tag is replaced by the URL of the page in which the contact form is placed. reference: https://contactform7.com/special-mail-tags/...
user avatar
  • 111
3 votes

How to get current url in contact form 7

You can use cf7 hidden field shortcodes + get parameters: https://contactform7.com/hidden-field/ https://contactform7.com/getting-default-values-from-the-context/ In the mail form I use such ...
user avatar
  • 331
3 votes

How to get current user's phone number

<?php // number 9 will be user ID $all_meta_for_user = get_user_meta( 9 ); print_r( $all_meta_for_user ); // find the key that you want Array ( [first_name] => Array ( [0] => Tom )...
user avatar
2 votes

How do I embed a Javascript form directly into a page?

The quick and dirty way (but less dirty than page by page edits) would be a shortcode: function my_sharpspring() { $str = <<<EOD <!-- SharpSpring Form for General Contact Form --> <...
user avatar
  • 63.6k
2 votes
Accepted

How do I embed a Javascript form directly into a page?

Here's a Step by Step Guide to adding Javascript into Pages: Step 1: Log into WordPress Step 2: Navigate to whichever page you want to add the scripts onto. Step 3a: If you have some kind of Page ...
user avatar
  • 19.6k
2 votes

Is there a way to embed a Google Docs form in a page without using plugins?

You should be able to paste the HTML of the Google Docs iframe directly into the page by using the TEXT mode of the edit form (instead of the VISUAL) mode. That mode allows you to enter the HTML ...
user avatar
  • 303
2 votes

How to get current user's phone number

WordPress has a shortcut for getting the current user ID, which it sounds like you need-- get_current_user_id(). Using that you should be able to get the information you need. The following is a proof ...
user avatar
  • 63.6k
2 votes

How to get current user's phone number

If you are not looping all users and only want to get current user phone_number meta then you can try the below. $current_user_id = get_current_user_id(); $phone = get_user_meta($current_user_id,'...
user avatar
  • 1,633
2 votes

Contact form sender email

Sending an email from an address you don't own will mean you run into problems with countermeasures again email spoofing (e.g SPF), as you're effectively impersonating the user's email address to send ...
user avatar
2 votes

How to get current url in contact form 7

the form submit already send the container post then you just need to retrive it in and put it in the e-mail. For that, try this code : add_filter("wpcf7_posted_data", function ($wpcf7_posted_data) {...
user avatar
  • 3,594
2 votes
Accepted

Is Postfix required for WordPress contact forms in general?

You don't need Postfix if you use an SMTP plugin like, for example, WP Mail SMTP. Such kind of plugins can send email from your Google account via SMTP. I have just checked it by stopping postfix and ...
user avatar
  • 1,747
2 votes

How to change the contact info at the bottom of my theme

This theme downloads 2 folders with name kyma and spina. so, go to kyma\functions\customize where you get contact-widgets.php and change contact information there.
user avatar
  • 621
2 votes

How can I add a link to a WPForms "contact us" form to the main menu?

I imagine you'll need to create a "form" page and embed the form using a shortcode or block: There are two different ways to embed your forms to a WordPress page: by using the built-in ...
user avatar
  • 2,438
1 vote

How to Send Confirmation Emails to Users after Form Submission?

You need to take a look at the hooks of the Contact Form 7 plugin website. Browse the documentation for the actions you need. Have a look at this topic: how-to-hook-into-contact-form-7-before-send ...
user avatar
1 vote

Contact Form 7 If Condition

Yes, you should be able access the form fields and field values with event.detail.inputs in addEventListener on wpcf7mailsent. You can then use the field values in the conditional statements and add ...
user avatar
1 vote
Accepted

Display Freebie Page Content only if Referrer is from Form Page

If you want something that's simple, but not highly secure, a field you pass from the form to the download page is fairly common. Anyone with that field could get to your download page, but most ...
user avatar
  • 2,592
1 vote

form action wordpress and php

If you're using WordPress, you shouldn't send POST requests directly to current URL. There is an API to process such requests. So how should that be done? First of all, you should send request to ...
user avatar
1 vote
Accepted

Download any file after submitting a form

You can use "actions". More info: http://hookr.io/actions/wpcf7_mail_sent/ Put this code in your functions.php: function action_wpcf7_mail_sent( $contact_form ) { // here your file redirect ...
user avatar
  • 36
1 vote

How to change the contact info at the bottom of my theme

Spina is a child theme of Kyma theme. And what you are seeing is the 'footer sidebar' with several widgets defined in the footer.php in Kyma theme. But, they are displayed only if you don't add ...
user avatar
1 vote

WordPress Emails & Contact Forms

Your could debug php mailer in WP using franz's wpmail_exceptions plugin https://gist.github.com/franz-josef-kaiser/5840282 Place the first file in /wp-content/mu-plugins/ and make sure you've set ...
user avatar
  • 1,139
1 vote
Accepted

Jquery contact form to send mail to admin

Without php you can't send an email. So as per your reference you have to use ajax and php. In wordpress ajax is little bit different as compared to normal ajax. You can check the link for how to use ...
user avatar
1 vote
Accepted

After upgrading to PHP 7.0 my contact form outputs error

Wordpress has a built in function for validating emails and I would advise you use that. So you can replace your preg_match with the wordpress is_email else if (!preg_match("/^[A-Z0-9.%-]+@[A-Z0-9.%-...
user avatar
  • 2,821
1 vote

PHP- Why is my contact form keep showing it is invalid?

You should remove the <meta http-equiv=\"refresh\" content=\"0;URL=contactus.php\"> from your document head section, first. The problem Each time you press submit button on your form, you ...
user avatar
  • 2,223
1 vote

Contact form don't send Email

Most probably it's because SPF misconfiguration. SPF allows the owner of an Internet domain to specify which computers are authorized to send mail with sender addresses in that domain, using Domain ...
user avatar
1 vote
Accepted

Is it possible to create a contact form without using a plugin?

If you install Jetpack which is a product of Automattic/WordPress you will then have the form feature you mention in the link you provided. http://jetpack.me/support/contact-form/
user avatar
  • 451
1 vote

WP AJAX API with JS file

Currently I'm assuming that is is backend (front end is slightly different), but it's very easy to implement on the frontend if required. You are correct in thinking that because you haven't used the ...
user avatar
  • 3,170
1 vote
Accepted

contact form in template with jquery,validate and ajax

WordPress is running Jquery in noconflict mode. (WordPress Codex Reference) or read this brief article I posted some time ago. View it here. You need to replace: $(document).ready(function(){ With ...
user avatar
  • 1,593

Only top scored, non community-wiki answers of a minimum length are eligible