Skip Navigation

[Resolved] Email notification change label name for title

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by leilaG 4 years, 7 months ago.

Assisted by: Waqar.

Author
Posts
#1605889

Hi we have a CPT for Inquires, the form has 'Name' field, when we checked the entries in the admin panel, the entries were showing code - CRED Auto Draft 1c2135d0d330a934f14b3fd307dd49ba hidden link

Which I presume is because we are not using the title field in the form, so we replaced the 'Name' field with the title field, then the email notification label displays 'Space form entry Title' hidden link

Is there a way round this? to either edit the notification label of the title or to keep the name field but show this in the entries list of the admin panel?

#1606617

Hi Leila,

Thank you for contacting us and I'd be happy to assist.

When the post title field is not included in the Form and you'd like to generate that title from the value of another field (e.g. 'Name' field in your case), you can use the "cred_submit_complete" hook:
( ref: https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete )

Example:


add_action('cred_submit_complete', 'my_success_action',10,2);
function my_success_action($post_id, $form_data)
{
	// if a specific form
	if ($form_data['id']==123)
	{
		$my_post = array(
			'ID' => $post_id,
			'post_title' => $_POST["wpcf-name"],
			'post_name' => $_POST["wpcf-name"]
		);

		// Update the post into the database
		wp_update_post( $my_post );
	}
}

Note: you'll replace 123 with the actual ID of your form and "name" with the actual slug of your "Name" field.

The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through active theme's "functions.php" file.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1606675

Exactly what we needed! Thanks for your help 🙂