I'm making a web site with Wordpress, in which there is a form that has to be filled by customers. I want for every customer that will apply, after complete the filling and get the success message, to get via email a unique number and then contact with the company for the rest procedures. I'm also using contact-form-7 plugin for the form. Any idea or any plugin that could do this automatically? Even if code is needed, let me know! Thanks in advance!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You could use the contact-form-7-dynamic-text-extension plugin.
Install the plugin, add
/* Generate Quote Ticket */
function genTicketString() {
return substr(md5(uniqid(mt_rand(), true)), 0, 8);
}
add_shortcode('quoteticket', 'genTicketString');
to your functions.php and add
Your Reference number: [dynamictext ticket "quoteticket"]
to your form in contact form 7. (or make this field invisible through css)
Lastly, add [ticket] to your e-mail body.
Found this solution on http://wordpress.org/support/topic/contact-form-7-generating-reference-number and was written by AMCD.