Problem/Motivation
We're calling out to procedural code from OO stuff to use drupal_mail, eg Drupal\contact\MessageForm.
Proposed resolution
Move drupal_mail to MailManager::mail
Move all the other mail.inc stuff to a new \Drupal\Core\Utility\Mail class.
We can't make it a component because it needs Settings and references base_url global.
Remaining tasks
Fix any failing tests
Reviews
User interface changes
None
API changes
- drupal_mail() » \Drupal::service('plugin.manager.mail')->mail()
- drupal_mail_system() » \Drupal::service('plugin.manager.mail')->getInstance()
- drupal_wrap_mail() » \Drupal\Core\Utility\Mail::wrapMail()
- drupal_html_to_text() » \Drupal\Core\Utility\Mail::htmlToText()
- _drupal_wrap_mail_line() » \Drupal\Core\Utility\Mail::wrapMailLine()
- _drupal_html_to_mail_urls() » \Drupal\Core\Utility\Mail::htmlToMailUrls()
- _drupal_html_to_text_clean() » \Drupal\Core\Utility\Mail::htmlToTextClean()
- _drupal_html_to_text_pad() » \Drupal\Core\Utility\Mail::htmlToTextPad()