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.

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

报告相同问题?

悬赏问题

  • ¥15 为什么apriori的运行时间会比fp growth的运行时间短呢
  • ¥15 帮我解决一下膳食平衡的线性规划模型的数据实例
  • ¥40 万年历缺少农历,需要和阳历同时显示
  • ¥250 雷电模拟器内存穿透、寻基址和特征码的教学
  • ¥200 比特币ord程序wallet_constructor.rs文件支持一次性铸造1000个代币,并将它们分配到40个UTXO上(每个UTXO上分配25个代币),并设置找零地址
  • ¥15 关于Java的学习问题
  • ¥15 如何使用chatgpt完成文本分类任务?
  • ¥15 已知速度v关于位置s的等式,怎么转化为已知位置求速度v的等式
  • ¥15 我有个餐饮系统,用wampserver把环境配置好了,但是后端的网页却进去,是为什么,能不能帮远程一下?
  • ¥15 R运行没有名称为"species"的插槽对于此对象类"SDMmodelCV"