我在Envato上购买了一个主题,但似乎团队无法(或不想)帮助我。
在每个属性页上,我们都有一个按钮,用于在模式框中调用表单。 我自己添加了一些字段,但是我不知道如何通过邮件发送新数组。
因此,表单的工作方式如下:
名为form.php的文件包含:
<div class="mkdf-property-enquiry-holder">
<div class="mkdf-property-enquiry-inner">
<a class="mkdf-property-enquiry-close">
<?php echo zuhaus_mikado_icon_collections()->renderIcon( 'icon_close_alt', 'font_elegant' );?>
</a>
<form class="mkdf-property-enquiry-form mkdf-style-form" method="POST">
<label class="formx"><?php echo get_the_title();?></label>//ADDED FIELD
<label class="formx"><?php echo get_the_ID();?></label>//ADDED FIELD
<label><?php esc_html_e('Full Name', 'mkdf-real-estate'); ?></label>
<input type="text" name="enquiry-name" id="enquiry-name" placeholder="<?php esc_html_e( 'Your Full Name', 'mkdf-real-estate' );?>" required pattern=".{6,}">
<label><?php esc_html_e('E-mail Address', 'mkdf-real-estate'); ?></label>
<input type="email" name="enquiry-email" id="enquiry-email" placeholder="<?php esc_html_e( 'Your E-mail Address', 'mkdf-real-estate' );?>" required pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$">
<label><?php esc_html_e('GSM / TEL'); ?></label>
<input type="phone" name="enquiry-phone" id="enquiry-phone" placeholder="<?php esc_html_e( 'Téléphone / GSM', 'mkdf-real-estate' );?>" required>
<label><?php esc_html_e('Your Message', 'mkdf-real-estate'); ?></label>
<textarea name="enquiry-message" id="enquiry-message" placeholder="<?php esc_html_e( 'Your Message', 'mkdf-real-estate' );?>" required></textarea>
<?php echo zuhaus_mikado_get_button_html(array(
'text' => esc_html__('Send Your Message', 'mkdf-real-estate'),
'html_type' => 'button',
'type' => 'solid',
'custom_class' => 'mkdf-property-single-enquiry-submit'
)); ?>
<input type="hidden" id="property-item-id" value="<?php echo get_the_ID(); ?>">
<?php wp_nonce_field('mkdf_re_validate_property_item_enquiry', 'mkdf_re_nonce_property_item_enquiry'); ?>
</form>
<div class="mkdf-property-enquiry-response"></div>
</div>
</div>
然后,有一个名为function-helper的文件,其中包含:
//Get post id from request
$post_id = $email_data['itemId'];
//Get email address
$contact_user = mkdf_re_get_property_contact_user($post_id);
$mail_to = $contact_user->user_email;
$headers = array(
'From: ' . $name . ' <' . $email . '>',
'Reply-To: ' . $name . ' <' . $email . '>',
);
$additional_emails = array();
$additional_emails[] = $mail_to;
$headers[] = 'Bcc: ' . implode(',', $additional_emails);
$messageTemplate = esc_html__('Bien', 'mkdf-real-estate'). ': ' . XXXXXXX . "\r\n";
$messageTemplate .= esc_html__('ID du Bien', 'mkdf-real-estate'). ': ' XXXXXXX "\r\n";
$messageTemplate .= esc_html__('De', 'mkdf-real-estate'). ': ' . $name . "\r\n";
$messageTemplate .= esc_html__('Message', 'mkdf-real-estate') . ': ' . $message . "\r\n\n";
$messageTemplate .= esc_html__( 'Message envoyé par le site', 'mkdf-real-estate' ) . ' ' . get_bloginfo('name') . ' - ' . esc_url( home_url('/') );
我的问题是,如何在function-helper.php中添加缺少的字段? 缺少的字段写为XXXXXXX。
以下是查看模式框的链接:http://www.iaci.be/property/villa/#