Shortcode not working in HTML or Email notification
-
Hi,
first, thanks for this great plugin.
I try to execute my own shortcode (in function.php of child-theme) in forminator fields, but the shortcode isn’t replaced or processed.
I use a form where an user can put name and email to generate a personal certificate. This certificate, created by e2pdf, is attached to the email by e2pdf-shortcode. This works very well.
Now I would like to add a second attachment to the email, namely the featured image of the post in which the form is embedded. I tried a shortcode [add_feature_image post={embed_id}]:
function insert_featuredimage_url( $atts , $content = null ) { $output=''; $a = shortcode_atts([ 'post' => '', ], $atts); $post_id = isset($atts['post']) ? (int) $atts['post'] : false; if($post_id) { $output = get_the_post_thumbnail_url((int) $post_id, 'full'); } return $output; } add_shortcode( 'add_feature_image', 'insert_featuredimage_url' );But all I get is [add_feature_image post=12345]. The embed-id is replaced but the shortcode isn’t processed, I guess.
The shortcode is working btw, I added the [add_feature_image post=12345] to the post and the url is showing.
Do you have any ideas?
The topic ‘Shortcode not working in HTML or Email notification’ is closed to new replies.