9ответ(ов) в теме
add_action('pfm_add_topic','pfm_send_admin_mail_new_topic_custom',10);
function pfm_send_admin_mail_new_topic_custom($topic_id){
global $user_ID;
if(!pfm_get_option('admin-notes') || rcl_is_user_role($user_ID, 'administrator')) return false;
$topic = pfm_get_topic($topic_id);
if(!$topic) return false;
$email = 'сюда пишем email';
$subject = __('New forum topic','wp-recall');
$textmail = '<p>'.sprintf(__('On the forum of the site "%s" created a new topic!','wp-recall'),get_bloginfo('name')).'</p>';
$textmail .= '<p>'.__('The name of the topic','wp-recall').': <a href="'.pfm_get_topic_permalink($topic_id).'">'.$topic->topic_name.'</a>'.'</p>';
$textmail .= '<p>'.__('The topic author','wp-recall').': '.( $topic->user_id? get_the_author_meta('display_name',$topic->user_id): __('Guest','wp-recall') ).'</p>';
rcl_mail($email, $subject, $textmail);
}
а возможно указать две почты?
код не работает
add_action('pfm_add_topic','pfm_send_admin_mail_new_topic_custom',10);
function pfm_send_admin_mail_new_topic_custom($topic_id){
global $user_ID;
if(!pfm_get_option('admin-notes') || rcl_is_user_role($user_ID, 'administrator')) return false;
$topic = pfm_get_topic($topic_id);
if(!$topic) return false;
$email = 'сюда пишем email';
$subject = __('New forum topic','wp-recall');
$textmail = '<p>'.sprintf(__('On the forum of the site "%s" created a new topic!','wp-recall'),get_bloginfo('name')).'</p>';
$textmail .= '<p>'.__('The name of the topic','wp-recall').': <a href="'.pfm_get_topic_permalink($topic_id).'">'.$topic->topic_name.'</a>'.'</p>';
$textmail .= '<p>'.__('The topic author','wp-recall').': '.( $topic->user_id? get_the_author_meta('display_name',$topic->user_id): __('Guest','wp-recall') ).'</p>';
rcl_mail($email, $subject, $textmail);
}
пробовал указывать и 1 и 2 email не работает?
пробовал указать 2 email в файле который отсылает в корне prime-forum. НЕ работает тоже. Вообще не отправляет
Добавлял емейл вот так
add_action('pfm_add_topic','pfm_send_admin_mail_new_topic_custom',10);
function pfm_send_admin_mail_new_topic_custom($topic_id){
global $user_ID;
if(!pfm_get_option('admin-notes') || rcl_is_user_role($user_ID, 'administrator')) return false;
$topic = pfm_get_topic($topic_id);
if(!$topic) return false;
$email = '1 email';
$email = '2 email';
$subject = __('New forum topic','wp-recall');
$textmail = '<p>'.sprintf(__('On the forum of the site "%s" created a new topic!','wp-recall'),get_bloginfo('name')).'</p>';
$textmail .= '<p>'.__('The name of the topic','wp-recall').': <a href="'.pfm_get_topic_permalink($topic_id).'">'.$topic->topic_name.'</a>'.'</p>';
$textmail .= '<p>'.__('The topic author','wp-recall').': '.( $topic->user_id? get_the_author_meta('display_name',$topic->user_id): __('Guest','wp-recall') ).'</p>';
rcl_mail($email, $subject, $textmail);
}
Тема закрыта. Публикация новых сообщений запрещена.