我使用插件mailjet-for-wordpress。wordpress插件mailjet-for-wordpress無法在前端插入聯繫人屬性字段到簡報表格
我想要什麼
要用戶輸入thier標稱,prenom和電子郵件在前端是這樣的:http://gyazo.com/b58675c671584f8edc6ab6d703370ba9
我的問題
現場我只是添加像標稱, prenom它不會顯示在我的管理頁面中,當用戶使用subcribe時,與電子郵件字段相同:http://gyazo.com/9b72fdc03d22732cf21ddac9f70b2c33
我曾嘗試過
我試圖在mailjet中創建聯繫屬性字段,如nom,prenom。而且我還嘗試修改小部件「下載到我們的通訊」我在通訊表單中添加更多字段。我有修改如下代碼:
文件mailjet-widget.php
// WIDGET CODE GOES HERE
echo '
<form class="subscribe-form">
//add field nom
<input type="text" name="nom" placeholder="' . __('Nom', 'wp-mailjet') . '" class="username">
//add field prenom
<input type="text" name="prenom" placeholder="' . __('Prenom', 'wp-mailjet') . '" class="username">
//email it is original field in default newsletter mailjet form
<input id="email" name="email" value="" type="email" placeholder="' . __('[email protected]', 'wp-mailjet') . '" />
<input name="action" type="hidden" value="mailjet_subscribe_ajax_hook" />
<input name="list_id" type="hidden" value="' . $list_id . '" />
<input name="submit" type="submit" class="mailjet-subscribe" value="' . __($button_text) . '">
</form>
<div class="response">
</div>';
,並且在這種功能mailjet_subscribe_from_widget()
public function mailjet_subscribe_from_widget()
{
// Get some variables - email, list_id, etc.
$email = $_POST['email'];
$list_id = $_POST['list_id'];
//field add
$nom = $_POST['nom'];
$prenom = $_POST['prenom'];
// Add the contact to the contact list
$result = $this->api->addContact(array(
'Email' => $email,
'Nom' => $nom,
'Prenom' => $prenom,
'ListID' => $list_id
));
// Check what is the response and display proper message
if(isset($result->Status)) {
if($result->Status == 'DUPLICATE'){
echo '<p class="error">';
echo sprintf(__("The contact %s is already subscribed", 'wp-mailjet'), $email);
echo '</p>';
die();
}
else if($result->Status == 'ERROR'){
echo '<p class="error">';
echo sprintf(__("Sorry %s we couldn't subscribe at this time", 'wp-mailjet'), $email);
echo '</p>';
die();
}
}
// Adding was successful
echo '<p class="success">';
echo sprintf(__("Thanks for subscribing with %s", 'wp-mailjet'), $email);
echo '</p>';
die();
}
我試圖尋找和測試這樣的幾天但仍然不能得到結果。我是新的插件mailjet-for-word插件, 有誰知道幫我找到解決方案請,
先進的感謝,