Forum Replies Created

Viewing 15 replies - 1 through 15 (of 91 total)
  • LOL, so true πŸ™‚ Most refreshing reply I’ve read in ages.

    Welcome to Open Source plugin development I guess πŸ™

    Hi there, this is much appriciated!

    My code is the following:

     // Profile page contact form connect to profile id
     
    add_filter( 'ninja_forms_submit_data', 'my_ninja_forms_submit_data' );
    
    function my_ninja_forms_submit_data( $form_data ) {  
    	
     			$profile_id = um_profile_id();
    		 	$user_info = get_user_meta($profile_id, 'user_email', true);
    		 	 
    	
    	// IDs
       foreach( $form_data[ 'fields' ] as $key => $field ) { 
       if( $key == '47'){
    			 
         $form_data['fields'][$key]['value'] = $user_info; 
      }   
     
     
    	}

    // Form settings.
    $form_settings = $form_data[ ‘settings’ ];
    // Extra data included with the submission.
    $extra_data = $form_data[ ‘extra’ ];

    return $form_data;
    }

    And it results in being able to send the contact form submission to myself if visiting my own profile logged in, all else fails although the code to retrieve the user id etc works on the page.

    I have a feeling that this has something to do with the URL /admin/wp-admin.php from where the profile page is actually rendered, but I’m not sure and not capable to do something with this.

    I have created a hidden field placed in the ‘to’ field of the form which I’m using the ID (47) to target the filter to. Unfortunately the original code on NF (using key) did nothing for me.

    Thanks for any help!

    This is driving me insane, I am using the Ninja Forms filter above to populate a hidden field which I have added to the recipient field, but although the below code renders the correct profile email on the page itself I can seem to use it in the filter: it either returns the logged in user email or nothing at all when not logged in..

      function store_profile_id(){
    			global $ultimatemember; 
    			$profile_id = um_profile_id();
    		 	$user_info = um_fetch_user( $profile_id );
    		 	$send_to_emous =  um_user('user_email');
    	
    	echo $send_to_emous;
    	
    }
       

    =UPDATE UPDATE=

    All my above ideas have been the worst, they work but not as expected. The post meta key gets updated each time the page gets hit and therefor it is possible (and actually very probable with larger sites) that while a visitor is filling in the form, another will visit another profile page and change the recipient email address for all forms :))

    @suiteplugins Thank you for your suggestions I will check it out!

    =UPDATE=

    In hindsight it was not a good idea to update admin_email each time a form was send, been working on this too long. Status is now ‘work around’ using the following code which updates a post meta field. Would love to hear feedback on this solution and possible better ones.

    I have used the ACF plugin to add a custom field (key: custom_meta_key_emailz) to the profile page but of course native WP fields will work as well.

    I use Ninja Forms and set the “to” address with merge tag {post_meta:custom_meta_key_emailz}

    Code functions.php:

    // Send email to profile owner
    
    add_action('um_main_profile_fields', 'update_admin_email', 101);
    
    function update_admin_email() {
     
            // Get member email
       	$profile_id = um_profile_id();
    	$user_info = get_userdata($profile_id);
    	$send_to_emous = $user_info->user_email;
    	
            // Get custom field ACF
            $custom_emailz = get_post_meta( get_the_ID(), 'custom_meta_key_emailz', true );
    
            // Update field ACF, alter in case of native fields
            update_field('custom_meta_key_emailz', $send_to_emous, 2411);
    	
            // Optional to check: 
    	// echo '<p style="color:red;">$custom_emailz: ' . $custom_emailz . '</p>';
    	 	
    }

    It will update the meta key “custom_meta_key_emailz” to the member address on this page, thus rendering the correct email address in the “to” address.

    Anyone who would like to have a contact form on the profile page and have it send to the owner of the profile (member):

    I use Ninja Forms and set the ‘to’ address with merge tag {wp:admin_email}.

    Then add this code to functions.php:

    add_action('um_main_profile_fields', 'update_admin_email', 101);
    
    function update_admin_email() {
     
    	$profile_id = um_profile_id();
    	$user_info = get_userdata($profile_id);
    	$send_to_emous = $user_info->user_email;
       	
       	update_option('admin_email', $send_to_emous);
       	
    	// Optional to check: $email = get_option('admin_email');
            // Optional to check: echo '<p style="color:red;">' . $email . '</p>';
    
    }

    It will update the site admin email address to the member address on this page, thus rendering the correct email address in the ‘to’ address.

    Thread Starter Nick van de Veerdonk

    (@nmvdvjr)

    Thank you Mike, and thanks for a great plugin!

    Thanks @patunl, that did the trick!

    Plugin Author Nick van de Veerdonk

    (@nmvdvjr)

    Hi @kotlyarov,

    This is strange… I never had this issue before. In any case you can change the slug to add the slash, like so: [amp-sitemap append=’/amp’ ]

    Hope this helps and you will consider changing that brutal 1 star review πŸ™‚

    Thread Starter Nick van de Veerdonk

    (@nmvdvjr)

    Thank you Michael!

    Thread Starter Nick van de Veerdonk

    (@nmvdvjr)

    Hi Michael, excuse me for late reply! Thanks for your follow up on this, I see now. I was hoping to create a CSS selector/PHP conditional for a different page style by making it a custom post type but the way this works does not make for a good fit.

    Thanks again for your help and a fantastic plugin!

    Thread Starter Nick van de Veerdonk

    (@nmvdvjr)

    Post Types:
    {"portfolio_page":{"name":"portfolio_page","label":"Portfolio pages","singular_label":"Portfolio page","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"false","rest_base":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"page","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"false","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":[],"taxonomies":[],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":""},"custom_supports":""}}

    Taxonomies:
    {"custom_related_posts":{"name":"custom_related_posts","label":"Custom related posts","singular_label":"Custom related post","description":"","public":"false","hierarchical":"false","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"false","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"0","show_admin_column":"false","show_in_rest":"false","show_in_quick_edit":"true","rest_base":"","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":""},"object_types":["page"]}}

    Thread Starter Nick van de Veerdonk

    (@nmvdvjr)

    Hi Michael thank you for your swift reply!

    Got them pretty permalinks (/postname) and yes I’m flushing like a madman πŸ˜‰

    Thanks again!

    Debug:

    ### Begin Custom Post Type UI Debug Info ###

    Multisite: Yes

    SITE_URL: http://wordpresswebsite.amsterdam
    HOME_URL: http://wordpresswebsite.amsterdam

    WordPress Version: 4.9.1
    Permalink Structure: /%postname%/
    Active Theme: Parallax jaaadesign 9999

    Registered Post Types: post, page, attachment, revision, nav_menu_item, custom_css, customize_changeset, oembed_cache, acf-field-group, acf-field, nf_sub, product, product_variation, shop_order, shop_order_refund, shop_webhook, vc4_templates, portfolio_page, vc_grid_item, plugin_filter, plugin_group

    PHP Version: 5.6.33
    MySQL Version: 5.5.5
    Web Server Info: Apache/2

    Show On Front: page
    Page On Front: Home (#5)
    Page For Posts: (#0)

    WordPress Memory Limit: 3000MB

    TOTAL PLUGINS: 181

    MU PLUGINS: (1)

    Plugin Organizer MU: 9.3.4

    ACTIVE PLUGINS: (41)

    Advanced Custom Fields: Font Awesome: 2.1.0
    Advanced Custom Fields PRO: 5.5.14
    Column Shortcodes: 1.0
    Custom Post Type UI: 1.5.6
    Duplicate Post: 3.2.1
    Easy Smooth Scroll Links: 2.1.1
    Font Awesome 4 Menus: 4.7.0
    Genesis 404: 1.5.0
    Genesis Extender: 1.8.1
    Genesis Simple Edits: 2.2.0
    Headroom.js: 0.1
    Import External Images: 1.4
    More Privacy Options: 4.6
    New Blog Templates: 2.8.5
    New RoyalSlider: 3.3.5
    Ninja Forms: 3.2.8
    Optimize Database after Deleting Revisions: 4.4.2
    Page Links To: 2.9.9
    Photoswipe Masonry: 1.2.7
    PHP Text Widget: 1.0.8
    Plugin Organizer: 9.3.4
    Related Posts By Taxonomy: 2.3.2
    Simple Image Sizes: 3.1.1
    Simple Tooltips: 2.1.3
    Snapshot Pro: 3.1.4.1
    Superfly Menu: 4.3.3
    Table of Contents Plus: 1601
    WooCommerce: 3.2.6
    WooCommerce FreshBooks: 3.10.0
    WooCommerce PDF Invoices & Packing Slips: 2.1.3
    Wordfence Security: 6.3.22
    WordPress MU Domain Mapping: 0.5.5.1
    WPBakery Visual Composer: 5.2.1
    WP Featherlight: 1.2.0
    WP Google Analytics Events Pro: 2.2.6
    WP Google Fonts: v3.1.4
    WP Menu Cart Pro: 3.0.4
    WPMU DEV Dashboard: 4.3.2
    WP Smush Pro: 2.7.4.1
    Ye Olde Text Widget: 1.0.1
    Yoast SEO Premium: 4.9

    INACTIVE PLUGINS: (140)

    ACF Enhanced Message Field: 1.1.1
    ACF Options page: 1.0
    Active Plugins: 1.7
    Add From Server: 3.3.3
    AddQuicktag: 2.5.2
    Admin Columns – Advanced Custom Fields add-on: 1.3.5
    Admin Columns – WooCommerce add-on: 1.4
    Admin Columns Pro: 4.0.5
    Admin Quick Jump: 1.4
    Advanced Custom Fields: 4.4.12
    Ajax Search Lite: 4.7.12
    Ajax Search Pro: 4.9.7
    AMP: 0.5.1
    AMP Author Box: 1.0.4.1
    AMP footer widgets: 1.0.6.1
    AMP Recent Posts: 3.1.1
    AMP Related Posts: 2.2
    AMP Social Share: 2.2.1
    amr shortcode any widget: 3.6
    AuthorSure: 2.3
    Better Search Replace: 1.3.2
    Breadcrumb NavXT: 6.0.3
    BuddyPress: 2.9.2
    Carousel Anything for VC: 1.8
    Cloner: 1.7.7
    Contact Form 7: 4.9.2
    Custom Dashboard Widget: 1.0
    Custom Related Products for WooCommerce: 1.3
    Default featured image: 1.6.1
    Display Posts Shortcode: 2.9.0
    Disqus Conditional Load: 10.2.3
    Easy Content Types: 2.8.1
    Facebook Comments Plugin: 2.3.6
    Favicon Rotator: 1.2.7
    Follow-Up Emails: 4.4.18
    Gallery Carousel Without JetPack: 0.7.5
    GC Testimonials: 1.3.2
    Genesis Connect for WooCommerce: 0.9.9
    Genesis Favicon uploader: .1.1b
    Genesis Grid: 1.4.2
    Genesis Responsive Slider: 0.9.6
    Genesis Simple Sidebars: 2.1.0
    Genesis Tabs: 0.9.4
    Genesis Toolbar Extras: 1.6.0
    Genesis Translations: 2.4.1
    Genesis Widgetized Footer: 1.4.0
    GilidPanel: 2.1
    Glue for Yoast SEO & AMP: 0.4.2
    Google XML Sitemaps: 4.0.9
    Hide Admin Menu: 2.1.5
    Hyper Cache: 3.3.4
    iframe: 4.3
    Juiz Last Tweet Widget: 1.3.6
    Juiz Social Post Sharer: 1.4.8
    Lazy Facebook Comments: 2.0.1
    Limit Post Revisions Network Option: 4.6
    Local Search SEO Contact Page: 2.1.7
    Login Redirect: 1.0.9
    Looader: 2.07
    Microdata Manager: 1.0.0
    Minit: 0.9
    MinQueue: 1.1.2
    Mobile Menu: 2.5
    Multisite Plugin Manager: 3.1.6
    New User Approve: 1.7.5
    Ninja Forms – File Uploads: 3.0.3
    Ninja Forms – Layout & Styles: 1.2.7
    Ninja Forms – Multi-Part Forms: 1.3.5
    Pinterest Pin It Button For Images: 1.1.0
    Pinterest RSS Widget: 2.3.1
    Popup contact form: 6.3
    Postman SMTP: 1.7.2
    Recent Tweets Widget: 1.6.8
    Regenerate Thumbnails: 3.0.1
    Resize Image After Upload: 1.8.3
    Royal PrettyPhoto: 1.3
    Scroll Back to Top: 1.1.3
    Sharpen Resized Images: 2.0
    Shortcoder: 4.1.4
    Simple Follow Buttons Plus: 1.0.1
    Simple Lightbox: 2.6.0
    Simple Local Avatars: 2.0
    Simple Share Buttons Adder: 7.3.10
    Simple Share Buttons Plus: 1.1.4
    Simple Social Icons: 2.0.1
    Simply Show Hooks: 1.2.1
    Social Circles: 0.9.2
    Social Media Feather: 1.8.4
    Special Recent Posts PRO Edition: 3.0.6
    Subscribe by Email: 3.5.4
    Tabs Shortcode: 2.0.2
    Templatera: 1.1.10
    TG Facebook Comments: 1.5
    UberMenu – Flat Skins Pack Extension: 3.0
    UberMenu – Sticky Menu Extension: 3.0
    UberMenu 3 – The Ultimate WordPress Mega Menu: 3.2.7
    UberMenu Icons: 3.2.4
    Ultimate Addons for Visual Composer: 3.16.16
    Ultimate Branding: 1.9.0.1
    Use Any Font: 4.7.3
    User Synchronization: 1.1.5.6
    Ustyle: 1.0
    Velvet Blues Update URLs: 3.2.7
    Widget Icon: 1.1.3
    WooCommerce Customer/Order CSV Export: 4.3.5
    WooCommerce Local Pickup Plus: 1.13.5
    WooCommerce PayPal Express Gateway: 3.7.2
    WooCommerce PayPal Pro (Classic and PayFlow Editions) Gateway: 4.4.7
    WooCommerce PDF Invoices: 3.3.0
    WooCommerce Product Add-ons: 2.8.0
    WooCommerce Quantity Increment: 1.1.0
    WooCommerce Review for Discount: 1.6.3
    WooCommerce Stripe Gateway: 3.2.2
    WooCommerce Subscriptions: 2.1.3
    WooCommerce Tab Manager: 1.8.2
    WordPress Importer: 0.6.3
    WP-CRM: 1.1.3
    WP-DBManager: 2.79.1
    WP-FFPC: 1.11.2
    WP-Invoice: 4.1.9
    WP-Invoice: PDF: 2.1.0
    WP-Invoice: Quotes: 2.0.0
    WP All Export Pro: 1.3.0
    WP All Import – ACF Add-On: 3.1.0
    WP All Import Pro: 4.3.0
    WP Better Emails: 0.3
    WP Google Analytics Events: 2.5.0
    WP Google Maps: 6.4.06
    WP Google Maps – Pro Add-on: 5.60
    WPML CMS Nav: 1.4.20
    WPML Multilingual CMS: 3.7.1
    WPML Sticky Links: 1.4.1
    WPML String Translation: 2.5.4
    WPML Translation Management: 2.3.1
    WPPC Front End Form Extension for ACF (Free): 1.0.20
    WP Sticky Menu: 1.1.0
    Yoast SEO: 6.0
    Yoast SEO: Local: 4.9
    Yoast SEO: WooCommerce: 4.9
    YoImages: 0.1.8

    NETWORK ACTIVE PLUGINS: (8)

    New Blog Templates :2.8.5
    More Privacy Options :4.6
    Optimize Database after Deleting Revisions :4.4.2
    Snapshot Pro :3.1.4.1
    Wordfence Security :6.3.22
    WordPress MU Domain Mapping :0.5.5.1
    WP Google Analytics Events Pro :2.2.6
    WPMU DEV Dashboard :4.3.2

    Post Types:
    {"portfolio_page":{"name":"portfolio_page","label":"Portfolio pages","singular_label":"Portfolio page","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"false","rest_base":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"page","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"false","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":[],"taxonomies":[],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":""},"custom_supports":""}}

    Taxonomies:
    {"custom_related_posts":{"name":"custom_related_posts","label":"Custom related posts","singular_label":"Custom related post","description":"","public":"false","hierarchical":"false","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"false","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"0","show_admin_column":"false","show_in_rest":"false","show_in_quick_edit":"true","rest_base":"","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":""},"object_types":["page"]}}

    Hi I was wrestling with this myself and was able to solve this by setting the emails to plain text instead of HTML. You can do this under ‘Advanced settings’ at the bottom of the email action. (reply email, admin admin email etc.) Hope it helps!

    Plugin Author Nick van de Veerdonk

    (@nmvdvjr)

    That’s weird.. I will take a look at this, can you provide me a link to the site just to be sure?

Viewing 15 replies - 1 through 15 (of 91 total)