geoip-detect icon indicating copy to clipboard operation
geoip-detect copied to clipboard

Add Geoinfos to WPForms

Open benjaminpick opened this issue 1 year ago • 5 comments

Is your feature request related to a problem / specific use-case? Please describe. Similar to https://github.com/yellowtree/geoip-detect/wiki/API:-Shortcodes-for-Contact-Form-7#insert-the-geoinfos-of-the-user-into-the-email-text - can we add these Infos to Emails sent by WPForms?

Describe the solution you'd like Here is a tutorial how it works: https://wpforms.com/developers/how-to-create-a-custom-smart-tag/

benjaminpick avatar Jan 03 '24 16:01 benjaminpick

Status: test implementation in 5.4.0-beta1

ToDos left:

  • [x] wrap in ... depending on template??
  • [x] Add Documentation on Wiki

benjaminpick avatar Jan 06 '24 16:01 benjaminpick

Feedback on Beta Test Installation for Plugin Version 5.4.0-beta1:

Dear Benjaminpick,

I have today undertaken the beta test for the updated plugin, specifically Version 5.4.0-beta1, as per your request. However, I encountered certain issues during the installation process, hindering the activation of the plugin and, subsequently, the testing of WPForms Geoinfos.

Upon attempting to install the plugin, I received both a warning and a fatal error. The error messages are as follows:

Warning:

require(/home/websitename/public_html/blog/wp-content/plugins/geoip-detect-beta/vendor/composer/../myclabs/deep-copy/src/DeepCopy/deep_copy.php): failed to open stream: No such file or directory in /home/websitename/public_html/blog/wp-content/plugins/geoip-detect-beta/vendor/composer/autoload_real.php on line 55

Fatal Error:

Fatal error: require(): Failed opening required '/home/websitename/public_html/blog/wp-content/plugins/geoip-detect-beta/vendor/composer/../myclabs/deep-copy/src/DeepCopy/deep_copy.php' (include_path='.:/opt/alt/php74/usr/share/pear') in /home/websitename/public_html/blog/wp-content/plugins/geoip-detect-beta/vendor/composer/autoload_real.php on line 55

These errors have prevented the successful activation of the plugin, thereby impeding my ability to conduct a comprehensive test of WPForms Geoinfos.

I believe that addressing these installation issues will significantly contribute to the overall enhancement of your plugin. I appreciate your dedication to this project and look forward to your guidance in resolving these concerns.

Thank you once again for providing such a valuable plugin, and I am eager to assist further.

GitHubKitten avatar Jan 07 '24 13:01 GitHubKitten

Thank you for your try. Sorry I forgot something in my deploy script, I have released beta2 now and it works on my server, can you try again please? https://github.com/yellowtree/geoip-detect/archive/beta.zip

benjaminpick avatar Jan 09 '24 14:01 benjaminpick

Hi, thanks for the update. It installed without an error or warning now.

Only issue is that when I tested it, I don't currently get any geoip details in my notification email.

Here is the things I had filled in my email, as you can see, nothing was replaced by any actual data. Can you please confirm what are the tags I should be using? I assumed [geoip_detect2_user_info] ?

Entry id: {entry_id}

{entry_date format="m/d/Y"}

Page title: Contact

Client IP address (custom): {custom_ip_address}

Client IP address (WPForms): [_remote_ip]

Client IP address (custom): [display_ip]


Extra Mail Tags information below:

GeoIP Detection information: [geoip_detect2_user_info]

The sender’s user agent information: [_user_agent] The URL of the contact form: [_url] The date of the submission: [_date] The time of the submission: [_time] The ID of the post which contains the contact form: [_post_id] The name (slug) of the post which contains the contact form: [_post_name] The title of the post which contains the contact form: [_post_title] The permalink of the post which contains the contact form: [_post_url] The author name of the post which contains the contact form: [_post_author] The author email of the post which contains the contact form: [_post_author_email]

GitHubKitten avatar Jan 09 '24 15:01 GitHubKitten

Here are example codes for WP Forms:

{geoip_detect2_user_info}

{geoip_detect2_property_country__iso_code} {geoip_detect2_get_client_ip} {geoip_detect2_get_current_source_description}

They are also created when you click on "Show Smart Tags".

It is replacing the info for me, I am just wondering why it's showing at a different position of the E-Mail and depends on the option you choose on "Email Template", too.

benjaminpick avatar Jan 27 '24 13:01 benjaminpick