首页 文章

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

提问于
浏览
0

我正在尝试将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" hook或"wpcf7_after_send_mail",甚至使用CF7的第3方集成插件(http://wordpress.org/plugins/contact-form-7-3rd-party-integration/screenshots/),但不幸的是取得了很大的成功 .

我非常感谢你对此事的帮助 .

以下是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>

谢谢

1 回答

相关问题