LogoLogo
9.0.x
9.0.x
  • Overview
    • About Varbase
    • Roadmap
    • Release Cycle and Supported Versions
    • How to Get Support
  • Developers
    • Getting Started
    • Installing Varbase
      • Requirements
      • Installing Varbase with DDEV
      • Installing Varbase with Lando
    • Understanding Varbase
      • Basic Concepts
      • Core Components
        • Varbase Core
          • Varbase Admin
          • Varbase Page
          • Varbase Security
          • Varbase Webform
          • Varbase Default Content
          • Varbase Tour
        • Varbase Media
        • Varbase Editor
        • Varbase Email
        • Varbase SEO
        • Varbase Workflow
        • Varbase Layout Builder
          • Varbase Landing page (Layout Builder)
          • Varbase Heading Block
          • Varbase Rich Text Block
          • Varbase HTML Code Block
          • Varbase Media (Image/Video) Block
          • Varbase Gallery Block
        • Varbase Total Control Dashboard
        • Vartheme Claro
        • Vartheme BS4
      • Optional Components
        • Varbase API
        • Varbase Internationalization
        • Varbase Media Hero Slider
        • Varbase Carousels
        • Varbase Blog
        • Varbase Search
        • Varbase Social Single Sign-On
        • Varbase Media Twitter
        • Varbase Media Instagram
        • Varbase Content Planner
        • Varbase Bootstrap Paragraphs
          • Varbase Bootstrap Paragraphs Text and Image
        • Varbase Landing Page (Paragraphs)
      • Additional Components
        • Varbase Media Header
        • Varbase FAQs
        • Varbase Reports
        • Varbase Commerce
        • Varbase YouTube Import
      • Development Components
        • Varbase Development
        • Varbase Style Guide
        • Reroute Email
        • Varbase Updates Helper
    • Configuring a Varbase Site
      • Navigation
        • Defining Active Menu Trail Using Menu Position
      • Using View Modes Inventory
      • Content Moderation and Workflows
      • URL Aliases in Varbase/Drupal
        • Configuring URL Aliases
        • Managing URL Aliases
      • Managing URL Patterns for Multilingual Websites
      • Managing Date and Time Formats to Display Across the Site
      • Using Varbase Layout Builder
        • Creating a Landing Page With Varbase Layout Builder
        • Activating Varbase Layout Builder for Content Types
      • Configuring Pathologic When Going Live
      • Configuring SEO Features
        • Disallow Oembed Media Links
      • Configuring Security Features
        • Spam Protection
        • Password Policies
        • Other Security Kits
        • Flood Contorl
        • Enable HTTP Password Authentication
      • Configuring JSON:API Features
      • Configure Varbase Media Hero Slider
      • Configuring Varbase Media Header
      • Configuring Varbase Mailer Settings
        • Configure Symfony Mailer
        • Configure Swift Mailer
        • Switch From Swift Mailer to Symfony Mailer
      • Entity Definition Update Manager Class
      • Module Installer Factory Class
    • Theme Development with Varbase
      • Understanding The Vartheme Base Theme
      • Creating Your Own Theme
      • Local Tasks and Moderation Sidebar
      • Add Preloaded Fonts in Vartheme
      • Switch From Node SASS to Dart SASS for Old Sub-Themes
    • Launching a Varbase Site to Production
    • Updating a Varbase Site
      • Understanding Varbase Updater Package
      • Handling Patches When Updating
      • Handling Configuration Updates
      • Updating Varbase to work with Composer 2.0
      • Updating Drush to the Latest Stable Version
      • Version Update Guides
        • Updating Varbase ~9.0 to Drupal 10
        • Switch from CKEditor 4 to CKEditor 5 in Varbase ~9.1.0
        • Updating from Varbase 8.x to 9.x
    • Varbase Patches
    • Frequently Asked Questions (FAQs)
    • Extending Varbase
      • Overriding Varbase
      • Creating Your Own Feature
      • Creating A Sub Profile From Varbase
        • Varbase Sub Profile Generator
        • Varbase Sub Profile Basic Template
        • Varbase Sub Profile Basic Project Template
      • Install Needed YARN and Gulp Tools
      • Compiling Provided Component Styles
      • Check Standards/Practice Coding And Linting
  • Content Designers
    • Terminology
    • Accessing the Administration Area
      • Website Environments
    • User Management
      • Allow Email/Username Login & Registration
      • Default Roles and Site Personas
        • Edit Roles' Permissions
        • Managing Roles
      • Add User
      • Edit User
      • Masquerading as another user
    • Dashboard
      • Reports
    • Content Structure
      • EntityQueues
      • Menu Management
        • Add Menu Items
        • Update Menu Items
        • Adding a Page to the Menu
      • Taxonomies
        • Manage Vocabulary
        • Edit Vocabulary
        • List Terms
        • Add Terms
        • Reorder and Edit Terms
      • Webforms
        • Setting up Emails Handler Conditions
        • Setting up Confirmations Message Settings Types
    • Content Management
      • Create Content
        • Add a Basic page
        • Add a Landing page
        • Add Blog
        • Add Media
          • Image
          • Remote video
          • Video
      • Modify Content
      • Delete Content
      • Preview Content
      • Bulk Edit Content
      • Content Moderation
      • Publish Content
      • URL Alias
    • About Layout Builder
      • Section
      • Custom Blocks
        • Heading Block
        • Basic Block
        • Media Block(Image/Video)
        • Rich-Text Editor “WYSIWYG”
      • Managing Blocks
    • Search Engine Optimization
      • XML Sitemap
      • Meta Tags in Varbase
      • URL Redirects
      • Domain Redirects
      • Prevent a Single Content From Being Indexed
    • Site Configuration
      • System
        • Clearing Varbase Cache
        • Google analytics
        • Mail templates
      • User interface
      • Development
      • Varbase settings
      • Web services
    • Common Error Handling Tips
  • Contributing
    • Contributing to Documentation
Powered by GitBook
On this page
  • Steps to Switch to Symfony Mailer
  • Update Varbase Email to 9.0.2 or later
  • Copy the Old Swift Mailer Keys and Configs
  • Uninstall Swift Mailer and Mail System Modules
  • Enable the Symfony Mailer Module
  • Follow with the Configure Symfony Mailer Steps
  • Migrate Custom Templates In Custom Themes
  • Switch from inline Styling to Libraries
  • Migrate Custom Code or Custom Multiple Mailers
  1. Developers
  2. Configuring a Varbase Site
  3. Configuring Varbase Mailer Settings

Switch From Swift Mailer to Symfony Mailer

PreviousConfigure Swift MailerNextEntity Definition Update Manager Class

Last updated 1 year ago

The 9.0.x is managing a smooth switch from Swift Mailer to Symfony Mailer.

Using the same Varbase Email template file which works with both of them.

Only it's a matter of copying the old SMTP keys and configs to the Symfony Mailer way.

Steps to Switch to Symfony Mailer

Backup the site before any updates or changes.

Update Varbase Email to 9.0.2 or later

The 9.0.2 version later requires the Symfony Mailer module.

  • Kept the in the 9.0.x branch of Varbase Email, But switched the default config to use the Symfony Mailer module on the default installation.

  • Added the module, with all needed switching in code.

Copy the Old Swift Mailer Keys and Configs

Save any old configs for Swift Mailer or Mail System. Which had been sat before by

Uninstall Swift Mailer and Mail System Modules

The Symfony Mailer module can not be enabled along with the Mail System module in the same system.

In case of trying to enable the Symfony Mailer Back-compatibility module. The following message will show up under install extensions.

Uninstall Swift Mailer and Mail System modules

drush pm:uninstall swiftmailer
drush pm:uninstall mailsystem

Enable the Symfony Mailer Module

drush pm:enable symfony_mailer
drush pm:enable symfony_mailer_bc

Follow with the Configure Symfony Mailer Steps

Use the saved backup copy of Swift Mailer mail system configs.

Or import the Varbase email module configuration partially using Drush:

drush cim --partial --source=/app/docroot/modules/contrib/varbase_email/config/optional

Migrate Custom Templates In Custom Themes

No extra work is needed when no custom changes in themes in projects.

Follow the following steps when having any custom changes over styling.

Switch from inline Styling to Libraries

Symfony Mailer clears all raw styling CSS elements in the template.

Inline or style elements are cleared out in the email.html.twig ,varbase_email.html.twig template file.

Remove custom CSS styling from your custom changes in your custom theme.

Create a new library to attach the needed styles to the template.

Example: custom_subtheme.libraries.yml file in your custom Vartheme sub-theme

default.email-style.ltr:
  css:
    theme:
      css/theme/email-style.theme.ltr.css: {}

default.email-style.rtl:
  css:
    theme:
      css/theme/email-style.theme.rtl.css: {}

Having a custom LTR ( Left to right ) and RTL (Right to left ) styling in separate files and libraries, to override the default Varbase Email libraries.

Symfony Mailer only allows attaching the custom style to the template using the default Drupal library system.

The Varbase Email module has two libraries that can be extended or overridden.

Example: custom_subtheme.info.yml file in your custom Vartheme sub-theme

libraries-override:
  varbase_email/default.email-style.ltr: custom_subtheme/default.email-style.ltr
  varbase_email/default.email-style.rtl: custom_subtheme/default.email-style.rtl

Migrate Custom Code or Custom Multiple Mailers

Symfony Mailer allows each module to have custom email templates and other sending transport.

The default transport service will be used when no custom transport was configured for the module. When a custom or contrib module is trying to send emails it will use the default. Unless a custom Symfony Mailer plugin was developed to support the contrib module with more options.

If the old project had any custom code or custom multiple mailers in the same system. The code should be migrated to configs. Using the Symfony Mailer plugin system.

Varbase Email
Updating a Varbase Site
Swift Mailer
Symfony Mailer
Configure Swift Mailer
Configure Symfony Mailer
Symfony Mailer Back-Compatibility Module Cannot Be Installed With the Mail System Module