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
  • Mailer Policy
  • Import Configuration
  • Add SMTP Transport Service
  • Set the Email Logo for Symfony Mailer Template
  • Custom Templates and Styling In Custom Themes
  1. Developers
  2. Configuring a Varbase Site
  3. Configuring Varbase Mailer Settings

Configure Symfony Mailer

PreviousConfiguring Varbase Mailer SettingsNextConfigure Swift Mailer

Last updated 2 years ago

Have a look at the official documentation for the Symfony Mailer module

See

Mailer Policy

Navigate to Administration \ Configuration \ System \ Mailer

To configure Mailer Policy to customize outgoing emails in many different ways. There are many possible policies to apply including: subject; body; addresses (from, to, ...); theme; transport; convert to plain text. Each policy can be set globally or for emails of a specific type.

Import Configuration

You can import configuration from existing modules to create an equivalent Mailer Policy. It is recommended to run the import at the beginning, before you start editing policy.

Warning importing overwrites existing policy. If you have already created working policy then you should skip the import.

If the Symfony Mailer module was enabled on the site for the first time. The site will keep prompting the following error message.

Error message

Click on import from the alert message or navigate to Administration \ Configuration \ System \ Mailer policy \ Import configuration

Import All or only Import needed changes for:

  • Update notification addresses (update)

  • User email settings (user): This overrides the default HTML messages with imported plain text versions.

Add SMTP Transport Service

Navigate to Administration \ Configuration \ System \ Mailer policy \ Transports

To see the list of mailer transports.

  • Select SMTP from the list of transport types, and click on the Add transport button

  • Fill in the Label for the SMTP service

  • Fill in the User name for the SMTP service. It could be the same email sender created in the SMTP service provider

  • Provide the password to log in with it

  • Provide the Hostname public SMTP domain provider

  • Use the right SMTP port, which the provider recommends to use

Press the Save submit button to save the SMTP transport

A message of "The transport configuration has been saved." will show up and the page will be redirected back to the Mailer transports configuration page.

Set the STMP transport as the default transport sender for emails, by clicking on "Set as Default" from the operations list for the SMTP transport.

Set the Email Logo for Symfony Mailer Template

  • Generate a new sub-theme following with Creating Your Own Theme

  • Enable the new custom sub-theme for example and set it as the default theme on the site.

  • Navigate to Administration \ Appearance \ Appearance settings \ A Custom Sub Theme of Vartheme

The email logo custom theme settings can be filled as desired

The provided Email Logo will feed the Symfony Mailer template with the selected logo, which it will be linked in the email.

Custom Templates and Styling In Custom Themes

When the custom theme for a project did not have any changes. No extra work is needed at this point.

Change the following steps when having any changes over the custom theme in the project.

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

Create a new library to attach the needed styles to it

Example: custom_subtheme.libraries.yml file

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: {}

Have all 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 styling to the template using the default Drupal library system.

The Varbase Email module has two libraries which are attached to the Symfony email template. They 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

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.

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.

There are Mailer configuration import operations pending: .

and provide theme settings for emails too. Vartheme sub-themes followed with that too.

Vartheme BS4
Vartheme BS5
https://www.drupal.org/docs/contributed-modules/symfony-mailer-0
Mailer Policy
Error Message to Import Configuration at the Back-end
Error Message to Import Configuration at the Front-end
Import Configuration with Import All option
Imported All Configurations
Mailer Transports Configuration Page
Example Add SMTP Transport
The Transport Configuration Has Been Saved
Set a Transport as Default
Email Logo Settings in Vartheme and Vartheme Sub Themes
import