duanhao7786 2013-09-29 10:08
浏览 32
已采纳

Wordpress联系表格7和第3方集成

I am trying to integrate wordpress CF7 with a third party CRM. I managed to send the data to the CRM using the following filter:

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';
}

Basically what i did is changing the "form action" from the regular CF7 to the WebtoLead action. I also mapped the Cf7 form with the following attributes (taken from the CRm sample form):

[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]

So this did work for me and i managed to receive the data on the CRM, but as i need the data to be stored in the wordpress database as well, i would like it to be both send to the CRM and keep the regular wordpress functionality.And as I cannot use 2 "actions" in 1 form i have to use some different way.

I was trying to implement this by using a few methods , like using "wpcf7_before_send_mail" hook or "wpcf7_after_send_mail", and even using a 3'rd party integration plugin for CF7 (http://wordpress.org/plugins/contact-form-7-3rd-party-integration/screenshots/) but unfortunatly with ot much success.

I would greatly appreciate your help on the matter.

Here is the full code of the sample Crm integration

<!--
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>         

Thank you

  • 写回答

1条回答 默认 最新

  • duangouhui0446 2013-09-30 11:32
    关注

    I managed to fix the problem using this great plugin: http://wordpress.org/plugins/contact-form-7-3rd-party-integration/screenshots/

    needs some modification but works great.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料