Title: subscribe2 で配信するメールにアイキャッチ画像を掲載したい
Last modified: 2016年7月30日

---

# subscribe2 で配信するメールにアイキャッチ画像を掲載したい

 *  [natsunoyuugure](https://ja.wordpress.org/support/users/natsunoyuugure/)
 * (@natsunoyuugure)
 * [12年、 7ヶ月前](https://ja.wordpress.org/support/topic/subscribe2-%e3%81%a7%e9%85%8d%e4%bf%a1%e3%81%99%e3%82%8b%e3%83%a1%e3%83%bc%e3%83%ab%e3%81%ab%e3%82%a2%e3%82%a4%e3%82%ad%e3%83%a3%e3%83%83%e3%83%81%e7%94%bb%e5%83%8f%e3%82%92%e6%8e%b2%e8%bc%89%e3%81%97/)
 * 新着記事が投稿された時のお知らせメール配信用として
    subscribe2を利用しています。
 * お知らせメールに記事のタイトルや寄稿者を表示することはできたのですが、
    ここに
   記事に設定しているアイキャッチを載せることができないものでしょうか？
 * いろいろ調べてみたのですが、それらしい回答が見当たらなかったので、
    アドバイス
   いただけると助かります。
 * ちなみに、
    subscribe2の設定にあるメールテンプレートの関連ファイルと思われる [
   subscribe2\classes]内の[class-s2-core.php]ファイルの199行目以降に以下の部分を
   見つけました。
 *     ```
       /* ===== mail handling ===== */
       /**
       Performs string substitutions for subscribe2 mail tags
       */
       function substitute($string = '') {
       if ( '' == $string ) {
       return;
       }
       $string = str_replace("{BLOGNAME}", html_entity_decode(get_option('blogname'), ENT_QUOTES), $string);
       $string = str_replace("{BLOGLINK}", get_option('home'), $string);
       $string = str_replace("{TITLE}", stripslashes($this->post_title), $string);
       $link = "<a href=\"" . $this->get_tracking_link($this->permalink) . "\">" . $this->get_tracking_link($this->permalink) . "</a>";
       $string = str_replace("{PERMALINK}", $link, $string);
       if ( strstr($string, "{TINYLINK}") ) {
       $tinylink = file_get_contents('http://tinyurl.com/api-create.php?url=' . urlencode($this->get_tracking_link($this->permalink)));
       if ( $tinylink !== 'Error' && $tinylink != false ) {
       $tlink = "<a href=\"" . $tinylink . "\">" . $tinylink . "</a>";
       $string = str_replace("{TINYLINK}", $tlink, $string);
       } else {
       $string = str_replace("{TINYLINK}", $link, $string);
       }
       }
       $string = str_replace("{DATE}", $this->post_date, $string);
       $string = str_replace("{TIME}", $this->post_time, $string);
       $string = str_replace("{MYNAME}", stripslashes($this->myname), $string);
       $string = str_replace("{EMAIL}", $this->myemail, $string);
       $string = str_replace("{AUTHORNAME}", stripslashes($this->authorname), $string);
       $string = str_replace("{CATS}", $this->post_cat_names, $string);
       $string = str_replace("{TAGS}", $this->post_tag_names, $string);
       $string = str_replace("{COUNT}", $this->post_count, $string);
       ```
   
 * ここに
    `$string = str_replace("{THUMBNAIL}", $this->post_thumbnails, $string);`
   と書き加えてみました。
 * これでメールテンプレートに{THUMBNAIL}と書いたら読み込んでくれるかな、と
    期待
   したのですが、無理でした。
 * 上記の方法であと一歩、であれば修正箇所を教えてください。
    全く別の方法でいいアイデア
   があればアドバイスいただけると助かります。
 * 長文になりましたが、どうぞよろしくお願いいたします。

1件の返信を表示中 - 1 - 1件目 (全1件中)

 *  トピック投稿者 [natsunoyuugure](https://ja.wordpress.org/support/users/natsunoyuugure/)
 * (@natsunoyuugure)
 * [12年、 7ヶ月前](https://ja.wordpress.org/support/topic/subscribe2-%e3%81%a7%e9%85%8d%e4%bf%a1%e3%81%99%e3%82%8b%e3%83%a1%e3%83%bc%e3%83%ab%e3%81%ab%e3%82%a2%e3%82%a4%e3%82%ad%e3%83%a3%e3%83%83%e3%83%81%e7%94%bb%e5%83%8f%e3%82%92%e6%8e%b2%e8%bc%89%e3%81%97/#post-174422)
 * 上記質問への追記です。
 * class-s2-core.phpファイルに書き加えた部分を
 * `$string = str_replace("{THUMBNAIL}", $this->post-thumbnails, $string);`
 * と編集してみたところ、
    配信されてきたメールに、[0]と表示されました。
 * 最終形はここにアイキャッチ画像を表示したいのですが、
    ひとまず[0]と表示された
   だけでも大きな進歩。
 * phpがよく分らないまま手探りで行っています。
    [0]が返ってきたということで期待が
   膨らんできているのですが、 どうして[0]なのでしょうか？
 * これをアイキャッチ画像の表示にするにはどうすれば良いですか？
 * ヒントだけでも頂けると助かります。
    よろしくお願いします。

1件の返信を表示中 - 1 - 1件目 (全1件中)

 トピック「subscribe2 で配信するメールにアイキャッチ画像を掲載したい」には新たに
返信することはできません。

## タグ

 * [アイキャッチ](https://ja.wordpress.org/support/topic-tag/%e3%82%a2%e3%82%a4%e3%82%ad%e3%83%a3%e3%83%83%e3%83%81/)
 * [メール配信](https://ja.wordpress.org/support/topic-tag/%e3%83%a1%e3%83%bc%e3%83%ab%e9%85%8d%e4%bf%a1/)
 * [画像](https://ja.wordpress.org/support/topic-tag/%e7%94%bb%e5%83%8f/)
 * [subscribe2](https://ja.wordpress.org/support/topic-tag/subscribe2/)

 * フォーラム: [プラグイン](https://ja.wordpress.org/support/forum/plugins/)
 * 1件の返信
 * 1人の参加者
 * 最後の返信者: [natsunoyuugure](https://ja.wordpress.org/support/users/natsunoyuugure/)
 * 最後の活動: [12年、 7ヶ月前](https://ja.wordpress.org/support/topic/subscribe2-%e3%81%a7%e9%85%8d%e4%bf%a1%e3%81%99%e3%82%8b%e3%83%a1%e3%83%bc%e3%83%ab%e3%81%ab%e3%82%a2%e3%82%a4%e3%82%ad%e3%83%a3%e3%83%83%e3%83%81%e7%94%bb%e5%83%8f%e3%82%92%e6%8e%b2%e8%bc%89%e3%81%97/#post-174422)
 * 状態: 未解決

## トピック

### 人気のトピック

### 返信がないトピック

### サポート関連ではないトピック

### 解決済みのトピック

### 未解決のトピック

### すべてのトピック
