Fires when a contact agrees to the site’s terms and conditions. Use this to record consent in a compliance system.
do_action( 'groundhogg/contact/agreed_to_terms', $contact );
You will receive the Contact object.
Example
add_action( 'groundhogg/contact/agreed_to_terms', 'my_extension_log_terms_consent' );
/**
* Record terms acceptance in a custom audit log.
*
* @param \Groundhogg\Contact $contact
*
* @return void
*/
function my_extension_log_terms_consent( $contact ) {
my_extension_audit_log( [
'event' => 'terms_agreed',
'contact_id' => $contact->get_id(),
'email' => $contact->get_email(),
'timestamp' => current_time( 'mysql' ),
'ip' => $contact->get_ip_address(),
] );
}
Was this helpful?
Let us know if this document answered your question. Thatβs the only way we can improve.
