function send_confirmation_email($data) { global $organization_details, $customer_email, $event_details; $data['eb'] = ''; $default_email_body = $this->epl->load_view('front/registration/regis-confirm-email', $data, true); $_notif = epl_get_element('_epl_event_notification', $event_details); $_notif_data = array(); if ($_notif && (!epl_is_empty_array($_notif) || $_notif != '')) { $id = is_array($_notif) ? current($_notif) : $_notif; $_notif_data = get_post($id, ARRAY_A) + (array) $this->ecm->get_post_meta_all($id); $data['eb'] = nl2br($this->notif_tags(stripslashes_deep(html_entity_decode($_notif_data['post_content'], ENT_QUOTES)))); } if (epl_is_empty_array($_notif) || $_notif == '' || epl_get_element('_epl_notification_replace', $event_details, 0) == 0) { $email_body = $this->epl->load_view('front/registration/regis-confirm-email', $data, true); } else { $email_body = $data['eb']; } $email_body = preg_replace('/<div class=\'epl_(.*?)_message\'>(.*?)<\\/div>/', '', $email_body); $from_name = html_entity_decode(epl_get_element('_epl_email_from_name', $_notif_data, get_bloginfo('name')), ENT_QUOTES); $from_email = epl_get_element('_epl_from_email', $_notif_data, get_bloginfo('admin_email')); $subject = html_entity_decode(epl_get_element('_epl_email_subject', $_notif_data, epl__('Registration Confirmation')), ENT_QUOTES); $headers = "From: \"" . $from_name . "\" <{$from_email}> \r\n"; $headers .= 'Reply-To: ' . $from_email . "\r\n"; $headers .= 'X-Mailer: PHP/' . phpversion(); $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; if (isset($customer_email) && $customer_email != '') { @wp_mail($customer_email, $subject, $email_body, $headers); } //admin email $_email = epl_get_event_property('_epl_alt_admin_email'); if ($_email == '') { $_email = epl_nz(epl_get_event_option('epl_default_notification_email'), get_bloginfo('admin_email')); } @wp_mail($_email, epl__('New Registration') . ': ' . get_the_event_title(), $default_email_body, $headers); }
epl_e('Registration Confirmation'); ?> </p> </td> </tr> <tr> <td valign="top" bgcolor="#ffffff" align="center"> <table cellspacing="0" border="0" cellpadding="0" width="700"> <tbody> <tr> <td valign="top" height="37" style="height: 37px;"> </td> </tr> <tr> <td valign="top" colspan="2" style="text-align: left;"> <h1 style="margin: 0; padding: 0; font-size: 22px; color: #fd2323; font-weight: bold;"><?php echo get_the_event_title(); ?> <?php epl_e('by'); ?> <?php echo get_the_organization_name(); ?> </h1> </td> </tr> <tr> <td valign="top" height="34" style="height: 34px; border-bottom-color: #d6d6d6; border-bottom-width: 1px; border-bottom-style: solid;">
function send_confirmation_email($body) { global $organization_details, $customer_email; $data = array(); $_email = get_bloginfo('admin_email'); $headers = 'From: ' . get_bloginfo('name') . " <{$_email}>" . "\r\n" . 'Reply-To: ' . "<{$_email}>" . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; if (isset($customer_email) && $customer_email != '') { @wp_mail($customer_email, epl__('Registration Confirmation') . ': ' . get_the_event_title(), $body, $headers); } @wp_mail($_email, epl__('New Registration') . ': ' . get_the_event_title(), $body, $headers); }
function send_confirmation_email($data) { global $organization_details, $customer_email, $event_details, $email_regis_form; //$data['email_body'] = ''; $attach_pdf = epl_get_setting('epl_api_option_fields', 'epl_invoice_attach_to_conf', 0) == 10 && epl_is_addon_active('_epl_atp'); $attach_pdf = apply_filters('epl_attach_invoice_to_conf_email', $attach_pdf); $defaults = array('admin_subject' => epl__('New Registration'), 'subject' => epl__('Registration Confirmation')); $default_email_body = $this->epl->load_view('email/default/template-no-custom', $data, true); $_notif = epl_get_element('_epl_event_notification', $event_details); if (epl_is_waitlist_flow()) { $_notif = epl_get_element('_epl_waitlist_notification', $event_details); $defaults['admin_subject'] = epl__('New Waitlist Addition'); } $_notif_data = array(); if (epl_sc_is_enabled() && !epl_is_waitlist_flow()) { $_notif = epl_get_setting('epl_sc_options', 'epl_sc_notification'); } if ($_notif && (!epl_is_empty_array($_notif) || $_notif != '')) { $id = is_array($_notif) ? current($_notif) : $_notif; $_notif_data = get_post($id, ARRAY_A) + (array) $this->ecm->get_post_meta_all($id); $data['email_body'] = $this->notif_tags($_notif_data['post_content'], $data); } if (epl_is_empty_array($_notif) || $_notif == '') { $email_template = 'email/default/template-no-custom'; $email_template_name = epl_get_element('_epl_email_template', $_notif_data); $email_template = $email_template_name ? 'email/' . $email_template_name . '/template.php' : $email_template; $data['base_url'] = EPL_EMAIL_TEMPLATES_URL . $email_template_name . '/'; $email_body = $this->epl->load_view($email_template, $data, true); } else { $email_body = $data['email_body']; } $email_body = preg_replace('/<div class=\'epl_(.*?)_message\'>(.*?)<\\/div>/', '', $email_body); $from_name = stripslashes_deep(html_entity_decode(epl_get_element('_epl_email_from_name', $_notif_data, get_bloginfo('name')), ENT_QUOTES)); $from_email = epl_get_element('_epl_from_email', $_notif_data, get_bloginfo('admin_email')); $subject = stripslashes_deep(html_entity_decode(epl_get_element('_epl_email_subject', $_notif_data, $defaults['subject']), ENT_QUOTES)); $headers = "From: \"" . $from_name . "\" <{$from_email}> \r\n"; $headers .= 'Reply-To: ' . $from_email . "\r\n"; $headers .= 'X-Mailer: PHP/' . phpversion(); $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; if ($attach_pdf) { $invoice = $this->erptm->invoice($data['post_ID']); $data['attachment'] = $this->make_pdf($invoice, true, true); } if (isset($customer_email) && count($customer_email) > 0) { $to = implode(',', $customer_email); @wp_mail($to, $subject, $email_body, $headers, epl_get_element('attachment', $data, null)); } //admin email $_email = epl_get_event_property('_epl_alt_admin_email'); if ($_email == '') { $_email = epl_nz(epl_get_event_option('epl_default_notification_email'), get_bloginfo('admin_email')); } $admin_email = array('email' => $_email, 'title' => $defaults['admin_subject'] . ': ' . get_the_event_title(), 'email_body' => $email_body, 'headers' => $headers, 'data' => $data); $admin_email = apply_filters('epl_admin_send_confirmation_email_args', $admin_email); @wp_mail($admin_email['email'], $admin_email['title'], $admin_email['email_body'], $admin_email['headers'], epl_get_element('attachment', $admin_email['data'], null)); if ($attach_pdf) { $this->delete_file($data['attachment']); } }