Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Used to generate the mail tags into the message body, blog post explaining how to use this gist:
var $ = jQuery;
var copy = "\n\n";
var i = 0;
$('#wpcf7-mail .mailtag.code.unused').each(function(){
var text = $(this).text();
var key = text.replace(/\[|]/g, '');
copy += key.replace(/\-|_/g, ' ').toLowerCase().replace(/\b[a-z]/g, function(letter) {
return letter.toUpperCase();
}) + ": " + text + "\n";
console.log('Lines Typed: ' + i);
$('#wpcf7-mail-body').val($('#wpcf7-mail-body').val() + copy);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.