mailing tag
-
I am struggling with Contact form 7 custom mail tags. I want to embed the category name of the page that users fill the form to the mailing but I could not solve it. I search online and found Contact Form 7 – Dynamic Text Extension. This is an add-on plugin for Contact form 7. Although developer listed down the guides, I could not get a result due to having less knowledge on PHP.
The code that I created for mailing tag is this
function my_postcategory()
{
$terms = get_the_terms( $post->ID , ‘publication-category’ );foreach ( $terms as $term ) {
echo $term->name;
}
}
add_shortcode( ‘my_postcategory’, ‘my_postcategory’);Can anyone help on this? I am not sure where I am doing wrong
Thanks
- The topic ‘mailing tag’ is closed to new replies.