
/**
 * 資料請求フォーム（ID: 274）の自動返信メールを強制的にHTML形式にしてデザインを適用する
 */
function mwform_html_mail_transform_274( $Mail, $values, $Data ) {
    // 管理画面で入力した普通のテキストの改行を、HTMLの改行（<br>）に変換
    $text_content = nl2br( $Mail->body );
    
    // ダウンロードURLを、綺麗なボタンのHTMLコードに置き換える
    $pdf_url = 'https://keiribank.co.jp/wp-content/uploads/2026/05/WP_Keribank_document-2026_won.pdf';
    $button_html = '<div style="text-align: center; margin: 30px 0;"><a href="' . $pdf_url . '" target="_blank" style="background-color: #0077c7; color: #ffffff; font-size: 16px; font-weight: bold; text-decoration: none; padding: 15px 35px; border-radius: 4px; display: inline-block; box-shadow: 0 4px 10px rgba(0, 119, 199, 0.3); letter-spacing: 0.05em;">資料をダウンロードする（PDF）</a></div>';
    
    // 全体を包む美しい枠組み（HTMLレイアウト）
    $html_body = '
    <div style="font-family: \'Helvetica Neue\', Arial, sans-serif; background-color: #f7fafc; padding: 40px 20px; color: #2d3748; line-height: 1.8;">
        <div style="max-width: 600px; margin: 0 auto; background-color: #ffffff; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); border-top: 6px solid #0077c7;">
            <div style="padding: 25px 30px; background-color: #ffffff; text-align: left; border-bottom: 1px solid #e2e8f0;">
                <span style="font-size: 18px; font-weight: bold; color: #0077c7;">経理バンク</span>
            </div>
            <div style="padding: 35px 30px; font-size: 15px;">
                ' . $text_content . '
            </div>
        </div>
    </div>';
    
    // テキストに書かれたURLの直後に、デザインされた青いボタンを差し込む
    $html_body = str_replace( $pdf_url, $pdf_url . '<br>' . $button_html, $html_body );

    // メールオブジェクトの本文を書き換え
    $Mail->body = $html_body;
    
    // プラグインのチェックボックスの有無を無視して、強制的にHTMLメールとして送信する設定
    if ( strpos( $Mail->headers, 'Content-Type:' ) === false ) {
        $Mail->headers .= "\r\nContent-Type: text/html; charset=UTF-8";
    } else {
        $Mail->headers = preg_replace( '/Content-Type:[^\r\n]*/', 'Content-Type: text/html; charset=UTF-8', $Mail->headers );
    }
    
    return $Mail;
}
add_filter( 'mwform_auto_mail_raw_mw-wp-form-274', 'mwform_html_mail_transform_274', 10, 3 );<?xml version="1.0" encoding="UTF-8"?>
<!-- This sitemap was dynamically generated on 2026年5月31日 at 10:35 PM by All in One SEO - the original SEO plugin for WordPress. -->

<?xml-stylesheet type="text/xsl" href="https://keiribank.co.jp/default.xsl?sitemap=root"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc><![CDATA[https://keiribank.co.jp/addl-sitemap.xml]]></loc>
		<lastmod><![CDATA[2026-05-31T07:44:28+00:00]]></lastmod>
	</sitemap>
	<sitemap>
		<loc><![CDATA[https://keiribank.co.jp/post-sitemap.xml]]></loc>
		<lastmod><![CDATA[2026-05-26T05:29:11+00:00]]></lastmod>
	</sitemap>
	<sitemap>
		<loc><![CDATA[https://keiribank.co.jp/page-sitemap.xml]]></loc>
		<lastmod><![CDATA[2026-05-31T07:44:28+00:00]]></lastmod>
	</sitemap>
	<sitemap>
		<loc><![CDATA[https://keiribank.co.jp/category-sitemap.xml]]></loc>
		<lastmod><![CDATA[2026-05-31T12:22:13+00:00]]></lastmod>
	</sitemap>
</sitemapindex>
