You are here

function swiftmailer_update_8104 in Swift Mailer 8.2

Update message settings.

File

./swiftmailer.install, line 74
Contains install and update functions for SwiftMailer.

Code

function swiftmailer_update_8104() {
  $config = Drupal::configFactory()
    ->getEditable('swiftmailer.message');
  $content_type = $config
    ->get('respect_format') ? '' : $config
    ->get('format');
  $config
    ->set('content_type', $content_type)
    ->set('text_format', $config
    ->get('filter_format'))
    ->set('generate_plain', $config
    ->get('convert_mode'))
    ->clear('format')
    ->clear('respect_format')
    ->clear('filter_format')
    ->clear('convert_mode')
    ->save();
}