Return a unique number to the customer after apply on our form (wordpress)

百般思念 提交于 2019-11-28 12:36:49

问题


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.



来源:https://stackoverflow.com/questions/20244975/return-a-unique-number-to-the-customer-after-apply-on-our-form-wordpress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!