custom-contact-forms icon indicating copy to clipboard operation
custom-contact-forms copied to clipboard

Please add also fields to Subject

Open yelch opened this issue 8 years ago • 2 comments

Please make fields also available in notification subjects aka Subject: New message by [Name] Tnx

yelch avatar Jan 14 '16 07:01 yelch

I would love to see this :)

Anyone knows a quick fix to include post-url in subject?

Thanks

CoMMyz avatar Jun 09 '16 22:06 CoMMyz

@yelch Until this is added as functionality, you can always customize a notification subject by hooking to the ccf_email_subject filter. User-submitted form data is accessible in the $submission array, with the internal unique slug serving as the field's key.

If, for example, the slug for your "name" field was user_name, the function would look like this:

function custom_email_subject( $subject, $form_id, $email, $form_page, $notification, $submission ) {
     return "New Message by " . $submission['user_name'];
}
add_filter( 'ccf_email_subject', 'custom_email_subject', 10, 6 );

quayzar avatar Mar 12 '17 15:03 quayzar