Force new users to accept terms AND privacy policy?

I’m sorry ihor and yevhen I’ve been searching the internet and testing wp-mail functions but I get an error.

I just need this to finish my website.

If you could tell me how to send the value “accepted policy” by email, I would appreciate it.

add_filter(
	'hivepress/v1/forms/user_register',
	function( $form ) {
		  $form['fields']['custom_message_terms_policy'] = [
			'caption' => 'I agree with <a href="#" target="_blank">privacy policy</a>',
			'type'      => 'checkbox',
			'required' => true,
			'_external' => true,
			'_order'    => 1000,
		];

		return $form;
	},
	1000
);

add_action(
	'hivepress/v1/models/user/register',
	function( $user_id, $values ) {
		if(isset($values['_terms'])){
			update_user_meta($user_id, 'hp_registration_terms_accepted', true);
		}
		
		if(isset($values['custom_message_terms_policy'])){
			update_user_meta($user_id, 'hp_registration_policy_accepted', true);
		}
	},
	10, 
	2
);

Please try using the wp_mail function to send an email programmatically, it accepts the email address, subject and message arguments (you can use it in the hivepress/v1/models/user/register action in the suggested snippet) wp_mail() | Function | WordPress Developer Resources Please consider hiring a developer to customize your site beyond the available HivePress features. While we’re happy to provide simple code snippets if they’re useful to others, there’s some fair use to this.

Thanks ihor / yevhen, with a lot of effort and looking for tutorials on the internet I have achieved it.
Now I try to put another acceptance check on the page to publish listing ad to pick up the option “I have read and accept the terms of use” and I want it to be recorded and displayed in the backend of each ad,
You don’t need to tell me how to do it, I’ll look again to see how to do it. But please can you tell me where I should save it?
I mean the “ad_filter” and “ad_action”.
Thank you very much

Translated with DeepL Translate: The world's most accurate translator (free version)

Please use the Code Snippets plugin to add and manage custom PHP code snippets Code Snippets – WordPress plugin | WordPress.org

I mean that I will look for a way to write a text in the area that I highlight in red but I don’t know what that area is called in html.
the area is accessing the wordpress menu /listing/quick edit/
Thank you. I pass you a jpg image

Unfortunately, there’s no simple code snippet - this requires advanced customizations. Please try customizing it using the collection of code snippets Search · user:hivepress · GitHub and other developer resources, or consider hiring someone for custom work https://fwd.cx/hLhc73mQCD9R

If it is valid by law It is possible to get information from the database or check the date in the received email

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.