前提・実現したいこと
プラグインは一切使わないで
mb_send_mailを使い、新規投稿時に
「HPが更新されました」というメールを飛ばしています。
$textに、投稿した記事のタイトルと内容を
メールにも表示したいのです。
関係ないかもですが、投稿時にメールが飛ぶ条件は以下のコードです。
if ( 'publish' == $new_status && 'publish' != $old_status && 'top_info' == $post->post_type ) {
新しく投稿された記事の
タイトルと本文がDBのどこに入っているかを特定し
その後$text内に、どのように書けばいいのでしょうか?
【追記】
function publishSentMail ( $new_status, $old_status, $post ) { if ( 'publish' == $new_status && 'publish' != $old_status && 'top_info' == $post->post_type ) { 送信先やテキスト $response = mb_send_mail( $to, $subject, $text, $header);
テーマ編集でfunctions.phpに直に書いております
回答1件
あなたの回答
tips
プレビュー