Special Mail Tags
You can get IP address by using [_remote_ip] in mail content.
Takayuki,
thanks for getting back to me so promptly.
I know that I can get IP address by using [_remote_ip] in mail content – I actually use it – but I also want to lookup the Country that the address relates to, so I use the Quick Flag plugin, which also gives me a nice graphic image of the National Flag!
For the moment I’ve simply added:
elseif ( ‘quick-flag’ == $name )
$output = do_shortcode(‘[quick-flag]’);
to the end of the function wpcf7_special_mail_tag_for_post_data() in the special-mail-tags.php file to achieve what I want – but would prefer a better solution that won’t break when I update Contact Form 7.
Thanks for your help with this – and for a great plugin.
Mike
Try this:
add_filter( 'wpcf7_special_mail_tags', 'your_special_mail_tag', 10, 3 );
function your_special_mail_tag( $output, $name, $html ) {
if ( 'quick-flag' == $name )
$output = do_shortcode( '[quick-flag]' );
return $output;
}
Place [quick-flag] where you wish the flag.
Takayuki,
brilliant !!
Works a treat.
I’m very grateful for A) a GREAT plugin B) an EXCELLENT solution C) the SPEED and QUALITY of your support
I’m in your debt
Many thanks
Mike
good day ,
thank you for the solution u mentioned in this post .
i’ve tried it but seems sth goes wrong in my recipient email .
User IP :60.53.86.128
IP Location : Malaysia (<img class=”quick-flag” title=”Malaysia” src=”http://www.nicollo.com/wp-content/plugins/quick-flag/img/flags/MY.gif” />)
any idea why the flag cant be shown in email
Thank You
I want to do something very similar but I want to pass my shortcode one of the cf7 variables. How do I get those in my function?
@ikawares & @tim Berneman: If you require assistance then, as per the Forum Welcome, please post your own topic.