function UM_Mail($user_id_or_email = 1, $subject_line = 'Email Subject', $template, $path = null, $args = array()) { if (absint($user_id_or_email)) { $user = get_userdata($user_id_or_email); $email = $user->user_email; } else { $email = $user_id_or_email; } $headers = 'From: ' . um_get_option('mail_from') . ' <' . um_get_option('mail_from_addr') . '>' . "\r\n"; $attachments = null; if (file_exists(get_stylesheet_directory() . '/ultimate-member/templates/email/' . get_locale() . '/' . $template . '.html')) { $path_to_email = get_stylesheet_directory() . '/ultimate-member/templates/email/' . get_locale() . '/' . $template . '.html'; } else { if (file_exists(get_stylesheet_directory() . '/ultimate-member/templates/email/' . $template . '.html')) { $path_to_email = get_stylesheet_directory() . '/ultimate-member/templates/email/' . $template . '.html'; } else { $path_to_email = $path . $template . '.html'; } } if (um_get_option('email_html')) { $message = file_get_contents($path_to_email); add_filter('wp_mail_content_type', 'um_mail_content_type'); } else { $message = um_get_option('email-' . $template) ? um_get_option('email-' . $template) : 'Untitled'; } $message = um_convert_tags($message, $args); wp_mail($email, $subject_line, $message, $headers, $attachments); }
function send($email, $template = null, $args = array()) { if (!$template) { return; } if (um_get_option($template . '_on') != 1) { return; } if (!is_email($email)) { return; } $this->attachments = null; $this->headers = 'From: ' . um_get_option('mail_from') . ' <' . um_get_option('mail_from_addr') . '>' . "\r\n"; $this->subject = um_get_option($template . '_sub'); $this->subject = um_convert_tags($this->subject, $args); if (isset($args['admin']) || isset($args['plain_text'])) { $this->force_plain_text = 'forced'; } // HTML e-mail or text if (um_get_option('email_html') && $this->email_template($template, $args)) { add_filter('wp_mail_content_type', array(&$this, 'set_content_type')); $this->message = file_get_contents($this->email_template($template, $args)); } else { $this->message = um_get_option($template); } // Convert tags in body $this->message = um_convert_tags($this->message, $args); // Send mail wp_mail($email, $this->subject, $this->message, $this->headers, $this->attachments); remove_filter('wp_mail_content_type', array(&$this, 'set_content_type')); // reset globals $this->force_plain_text = ''; }
function um_dynamic_user_profile_pagetitle($title, $sep = '') { global $paged, $page, $ultimatemember; $profile_title = um_get_option('profile_title'); if (um_is_core_page('user') && um_get_requested_user()) { um_fetch_user(um_get_requested_user()); $profile_title = um_convert_tags($profile_title); $title = $profile_title; um_reset_user(); } return $title; }
function um_profile_dynamic_meta_desc() { global $ultimatemember; if (um_is_core_page('user') && um_get_requested_user()) { um_fetch_user(um_get_requested_user()); $content = um_convert_tags(um_get_option('profile_desc')); $user_id = um_user('ID'); $url = um_user_profile_url(); if (um_profile('profile_photo')) { $avatar = um_user_uploads_uri() . um_profile('profile_photo'); } else { $avatar = um_get_default_avatar_uri(); } um_reset_user(); ?> <meta name="description" content="<?php echo $content; ?> "> <meta property="og:title" content="<?php echo um_get_display_name($user_id); ?> " /> <meta property="og:type" content="article" /> <meta property="og:image" content="<?php echo $avatar; ?> " /> <meta property="og:url" content="<?php echo $url; ?> " /> <meta property="og:description" content="<?php echo $content; ?> " /> <?php } }
function convert_locker_tags($str) { $str = um_convert_tags($str); return $str; }