Make WordPress Core


Ignore:
Timestamp:
09/01/2025 04:02:25 AM (3 months ago)
Author:
TimothyBlynJacobs
Message:

Mail: Support inline attachments.

MIME allows for referencing included attachments by their Content-ID header using the cid URL scheme. This can be used to embed images inline to the HTML message. For example, <img src="cid:logo">, will display the contents of message part with the Content-Id: <logo> header.

The wp_mail() function now supports including inline attachments through a new $embeds parameter. It accepts a map of Content-ID values to file paths. The wp_mail_embed_args filter can be used to customize the resulting PHPMailer::addEmbeddedImage method call.

Props jesin, swissspidy, chrisvendiadvertisingcom, SirLouen, mukesh27, yashjawale, iamadisingh.
Fixes #28059.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/pluggable/signatures.php

    r59828 r60698  
    138138                'headers'     => '',
    139139                'attachments' => array(),
     140                'embeds'      => array(),
    140141            ),
    141142            'wp_authenticate'                 => array( 'username', 'password' ),
Note: See TracChangeset for help on using the changeset viewer.