# Force new users to accept terms AND privacy policy?

**URL:** <https://community.hivepress.io/t/force-new-users-to-accept-terms-and-privacy-policy/863>\
**Category:** HivePress\
**Created:** [July 10, 2022, 7:26pm UTC](https://community.hivepress.io/t/force-new-users-to-accept-terms-and-privacy-policy/863 "2022-07-10T19:26:39Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![APORTODAS](https://community.hivepress.io/user_avatar/community.hivepress.io/aportodas/32/322_2.png) [@APORTODAS](https://community.hivepress.io/u/APORTODAS)\
**Post date:** [July 28, 2022, 11:29pm UTC](https://community.hivepress.io/t/force-new-users-to-accept-terms-and-privacy-policy/863/34 "2022-07-28T23:29:45Z")

</div>

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.

```auto
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
);

```

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [July 30, 2022, 1:06am UTC](https://community.hivepress.io/t/force-new-users-to-accept-terms-and-privacy-policy/863/36 "2022-07-30T01:06:30Z")

</div>

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](https://developer.wordpress.org/reference/functions/wp_mail/) 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.

---

<div class="post-metadata">

**Author:** ![APORTODAS](https://community.hivepress.io/user_avatar/community.hivepress.io/aportodas/32/322_2.png) [@APORTODAS](https://community.hivepress.io/u/APORTODAS)\
**Post date:** [August 2, 2022, 9:17am UTC](https://community.hivepress.io/t/force-new-users-to-accept-terms-and-privacy-policy/863/37 "2022-08-02T09:17:03Z")

</div>

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](http://www.DeepL.com/Translator) (free version)

---

<div class="post-metadata">

**Author:** ![yevhen](https://community.hivepress.io/user_avatar/community.hivepress.io/yevhen/32/23_2.png) [@yevhen](https://community.hivepress.io/u/yevhen)\
**Post date:** [August 2, 2022, 10:34am UTC](https://community.hivepress.io/t/force-new-users-to-accept-terms-and-privacy-policy/863/38 "2022-08-02T10:34:54Z")

</div>

Please use the Code Snippets plugin to add and manage custom PHP code snippets [Code Snippets – WordPress plugin | WordPress.org](https://wordpress.org/plugins/code-snippets/)

---

<div class="post-metadata">

**Author:** ![APORTODAS](https://community.hivepress.io/user_avatar/community.hivepress.io/aportodas/32/322_2.png) [@APORTODAS](https://community.hivepress.io/u/APORTODAS)\
**Post date:** [August 2, 2022, 11:08am UTC](https://community.hivepress.io/t/force-new-users-to-accept-terms-and-privacy-policy/863/39 "2022-08-02T11:08:57Z")

</div>

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

 ![listing](https://community.hivepress.io/uploads/default/original/2X/4/4562046cecd69e28b54aec5ce2476687da10020c.jpeg)

---

<div class="post-metadata">

**Author:** ![yevhen](https://community.hivepress.io/user_avatar/community.hivepress.io/yevhen/32/23_2.png) [@yevhen](https://community.hivepress.io/u/yevhen)\
**Post date:** [August 3, 2022, 10:38am UTC](https://community.hivepress.io/t/force-new-users-to-accept-terms-and-privacy-policy/863/42 "2022-08-03T10:38:21Z")

</div>

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](https://gist.github.com/search?q=user%3Ahivepress) and other developer resources, or consider hiring someone for custom work [https://fwd.cx/hLhc73mQCD9R](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

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [September 2, 2022, 10:38am UTC](https://community.hivepress.io/t/force-new-users-to-accept-terms-and-privacy-policy/863/43 "2022-09-02T10:38:30Z")

</div>

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

[Previous page](https://community.hivepress.io/t/force-new-users-to-accept-terms-and-privacy-policy/863.md?page=1)
