shortcode in email body w/ parameters atts
-
Hey guys, how can I make my contact form auto-reply emails to contain a custom shortcode that shows a template? this shortcode works on normal wordpress pages, but doesn’t work on CF7 email template., not even using this plugin.
this is my shortcode declared on functions.php
function sc_mostrarcursos($atts, $content = null) { extract(shortcode_atts(array( "id" => '1', ), $atts)); global $post; $postargs = array( 'post_type'=> 'product', 'order'=> 'DESC', 'post_type' => 'product', 'posts_per_page' => 1, 'post__in'=> array($id) ); $myposts = get_posts($postargs); $retour='<ul>'; foreach($myposts as $post) : setup_postdata($post); $retour.= get_template_part('template_curso'); endforeach; $retour.='</ul> '; return $retour; } add_shortcode("mostrarcursos", "sc_mostrarcursos");
and this how I’m rendering it, no success… emails arrive with the plain shortcode.
[mostrarcursos id=”5240″]
I checked the link shared, but there is not clue on how to put some parameters – atts from the shortcode dynamically… any hints???
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘shortcode in email body w/ parameters atts’ is closed to new replies.