WordPress联系表格7和第三方集成


Wordpress Contact Form 7 and 3'rd Party integration

我正在尝试将wordpress CF7与第三方CRM集成。我设法使用以下过滤器将数据发送到CRM:

add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url');
function wpcf7_custom_form_action_url()
{
    return 'https://www.myapps-systems.com/api/WebToLeed.asp';
}

基本上,我所做的是将"表单操作"从常规的CF7更改为WebtoLead操作。我还使用以下属性映射了 Cf7 表单(取自 CRm 示例表单(:

[hidden mbp1 "222626"]
[hidden URLToReturn "http://thankyoupage.com/thankyou"]
[hidden Companies_Account_Status_Code "546"]
[hidden Companies_Company id:Companies_Company "Website Enquiry"]
<div>
[text* Contacts_Contact id:Contacts_Contact class:name]<label>name*:</label>
[tel* Companies_PhoneNumber id:Companies_PhoneNumber class:telelabelhone]
<label>phone*:  </label>
[email Companies_Email id:Companies_Email class:email]<label> mail:‬</label>
[textarea Companies_Note 50x8 id:Companies_Note]<label>message:</label>
</div>
[submit  onclick="return OnButton1(); id:send_contact class:submit]

所以这对我有用,我设法在CRM上接收数据,但由于我也需要将数据存储在wordpress数据库中,我希望它既能发送到CRM,又能保持常规的wordpress功能。由于我不能在 1 种形式中使用 2 个"动作",我必须使用一些不同的方式。

我试图通过使用一些方法来实现这一点,例如使用"wpcf7_before_send_mail"钩子或"wpcf7_after_send_mail",甚至使用 CF7 的第三方集成插件 (http://wordpress.org/plugins/contact-form-7-3rd-party-integration/screenshots/(但不幸的是,OT取得了很大的成功。

我将非常感谢您在此事上的帮助。

这是示例 CRM 集成的完整代码

<!--
URL is in action attribute.
For all inputs the name attribute is used by the back-end system so don't change them
-->
<form id="big_contact_form" name="Web2LeedForm" action="https://www.myapps-systems.com/api/WebToLeed.asp" method="POST" onsubmit="return submitForm();">
    <input type="hidden" name="mbp1" value="222626"/>
    <input type="hidden" name="URLToReturn" value="http://test.co.il/contact/thankyou"/>
    <input type="hidden" name="Companies_Account_Status_Code" value="546" /> <!-- must be exactly this name and value -->
    <input type="hidden" id="Companies_Company" name="Companies_Company" value="website enquiry"/> <!-- the Companies_Company field is mandatory, we don't use it so we just fill it with a value -->
    <table>
        <tr>
            <td>*</td>
            <th class="form_label"><label for="Contacts_Contact">name: </label></th>
            <td><input class="input" type="text" id="Contacts_Contact" name="Contacts_Contact"/></td>
        </tr>                           
        <tr>
            <td>*</td>
            <th class="form_label"><label for="Companies_PhoneNumber">phone: </label></th>
            <td><input class="input" type="text" id="Companies_PhoneNumber" name="Companies_PhoneNumber"/></td>                                 
        </tr>                                                               
        <tr>
            <td></td>
            <th class="form_label"><label for="Companies_Email">mail: </label></th>
            <td><input class="input" type="text" id="Companies_Email" name="Companies_Email"/></td>                                 
        </tr>                               
        <tr>
            <td></td>
            <th class="form_label"><label for="Companies_Note">message:</label></th>
            <td><textarea id="Companies_Note" name="Companies_Note" rows="8" cols="50"></textarea></td>                                 
        </tr>                               
        <tr>
            <td></td>
            <td><input id="send_contact" name="submit" type="submit" value="שלח" /></td>                    
        </tr>                               
    </table>
</form>         

谢谢

我设法使用这个很棒的插件解决了这个问题:http://wordpress.org/plugins/contact-form-7-3rd-party-integration/screenshots/

需要一些修改,但效果很好。