<?php $contact = sp_get_contact(); if (is_single()) { $contact->send_email(); } ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <header> <?php if (is_single()) { ?> <h1><?php $contact->the_title(); ?> <?php edit_post_link(__('Edit', 'scoutwp_plugin'), '<span class="edit-link icon-pencil">', '</span>'); ?> </h1> <?php } else { ?> <h2><a href="<?php the_permalink(); ?>
* new template file for each one. For example, tag.php (Tag archives), * category.php (Category archives), author.php (Author archives), etc. * * @link https://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Fifteen * @since Twenty Fifteen 1.0 */ get_header(); ?> <?php $group = sp_get_group(); if ($group->email) { $contact = sp_get_contact('group', $group); $contact->send_email(); } ?> <article id="sp-group-sections-<?php echo $group->id; ?> " class="sp-group-sections sp-group-<?php echo $group->id; ?> "> <?php if (have_posts()) { ?> <header class="sp-group-header">
function send_to_gf_owners($to, $lead) { if (empty($this->options['enquiry_form_gf_property_id']) || !function_exists('sp_get_contact')) { return $to; } $this->id_field = $this->options['enquiry_form_gf_property_id']; if (!empty($this->id_field) && !empty($lead[$this->id_field])) { $contacts = sp_get_contact($lead[$this->id_field]); if (!empty($contacts)) { $contact = array_shift($contacts); $contactmetadata = get_post_custom($contact->ID); $email = array_shift($contactmetadata['contact_email']); if (!empty($email) && $this->is_valid_email($email)) { return $email; } } // Still here, that means no contact so send to owner. $owner_id = sp_get_owner($lead[$this->id_field]); if ($owner_id !== false) { $user = new WP_User($owner_id); if (!empty($user->user_email) && $this->is_valid_email($user->user_email)) { return $user->user_email; } } } return $to; }