Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#47822 closed enhancement (wontfix)

wp_staticize_emoji_for_email always converts text/html email symbols and has no way to override behavior

Reported by: majemedia's profile majemedia Owned by:
Milestone: Priority: normal
Severity: minor Version: 5.3
Component: Mail Keywords:
Focuses: Cc:


While a good portion of email clients respect inline styling (or styling at all) for text/html emails there are still a lot of corporate email systems that either strip this data or ignore it completely.

Example: the TM symbol. When detected in an email the wp_staticize_emoji_for_email converts it to an image and replaces it inline.

This enhancement is NOT about that functionality but rather allowing a way to override it and turn it off selectively from within the wp_mail process.

The patch I'm submitting with this ticket does it in a non-obtrusive way. Adding an additional optional argument to the wp_mail function with a default setting that maintains current behavior for anything that hooks to the wp_mail filter.

The patch also modifies the behavior of the wp_staticize_emoji_for_email function to look for this new argument and return the original $mail formatting before going through its flow.

Attachments (2)

47822.diff (1.8 KB) - added by majemedia 5 years ago.
patch for ticket
Screen Shot 2019-08-03 at 8.27.34 AM.png (28.3 KB) - added by majemedia 5 years ago.
Display of issue happening in email client that strips inline styles.

Download all attachments as: .zip

Change History (6)

5 years ago

patch for ticket

This ticket was mentioned in Slack in #core by majemedia. View the logs.

5 years ago

5 years ago

Display of issue happening in email client that strips inline styles.

#2 @SergeyBiryukov
5 years ago

  • Keywords reporter-feedback added

Hi @majemedia, thanks for the ticket!

I might be missing something, but if the goal is to disable wp_staticize_emoji_for_email() for specific emails, it should already be possible by removing the filter before calling wp_mail():

remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );

I don't see why a new (6th) argument is needed.

#3 @majemedia
5 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Thanks @SergeyBiryukov for THAT reminder. I'm closing as wontfix.

While my patch allowed for one less line of code it's not out of bounds to use remove_filter and was honestly not something I thought of when debugging.

#4 @desrosj
5 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.