[wp-trac] [WordPress Trac] #28059: Inline image attachments with wp_mail()
WordPress Trac
noreply at wordpress.org
Fri Aug 29 21:34:10 UTC 2025
#28059: Inline image attachments with wp_mail()
-------------------------------------------------+-------------------------
Reporter: jesin | Owner: SirLouen
Type: enhancement | Status: assigned
Priority: normal | Milestone: 6.9
Component: Mail | Version:
Severity: normal | Resolution:
Keywords: has-patch has-test-info has-unit- | Focuses:
tests add-to-field-guide |
-------------------------------------------------+-------------------------
Comment (by TimothyBlynJacobs):
Thanks for putting the dev note together @SirLouen!
Looking at the example usages has really solidified the need to have
predictable CID values. Since the path to the file is going to be dynamic,
not being able to write the template value with a fixed CID means you have
to do that interpolation you are showing in the example. I know there is a
filter available, but needing to add and then remove a filter around your
`wp_mail` call is awkward. A developer shouldn't need to use a filter to
accomplish what looks like will be the common case.
Let's try a different signature where the `cid` value is the array key. I
don't think we need to support the same new line parsing, or array
conversion that we do for the `headers` parameter for instance.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28059#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list