Date Published: March 12, 2024
How To Configure Symfony Mailer module with Current Drupal
This page provides instructions for configuring the Symfony Mailer module with the current version of Drupal on Acquia Cloud Platform and Acquia Cloud Site Factory.
Pre-requisites
These instructions assume that you have configured your Cloud Platform or Site Factory application for use with Acquia Platform Email. If you have not done so, follow the guidance on this page to complete proper configuration.
Symfony Mailer is compatible with Platform Email on Cloud Platform. To correctly configure this module, you must update the following code in the sites/default/settings.php file:
$settings['mailer_sendmail_commands'] = [
'/usr/sbin/sendmail -t'
];
Configuring Symfony Mailer module with current Drupal on Site Factory¶
Installation and configuration¶
- Uninstall the mailer module
- Uninstall the SwiftMailer module
- Install the Symfony Mailer module
- Edit the file,
factory-hooks/post-settings-php/bv-acsf-settings.php, and add the following line of code:$settings['mailer_sendmail_commands'] = [ "/usr/sbin/sendmail -t" ];
- Navigate to
admin/config/system/mailer/transport - If you have not added a Sendmail item to the Transport type field, then click on Add Transport,
Otherwise click on Edit for the Sendmail item. - Choose the "
/usr/sbin/sendmail -t " for the Command field selection, instead of the default one
The installation and configuration of the Symfony Mailer module is now complete!
Confirming Installation and Configuration¶
Once you have followed the steps to install and configure the Symfony Mailer module in your Drupal application, you can verify that this is set up correctly using the following:
- Confirm configuration is valid using drush:
Use the following drush command to confirm that the configuration is valid:
drush --uri=<site_url> cget symfony_mailer.mailer_transport.sendmail
Example Expected output:
drush --uri=https://my.example/com cget symfony_mailer.mailer_transport.sendmail
uuid: bb7fc178-f5a4-4e99-acc4-b6140cc84d1a
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: JlhtZGzrKvb_1TFIVW-o2lEEoew2ixHkdpZ1WzIkJMY
id: sendmail
label: Sendmail
plugin: sendmail
configuration:
query:
command: '/usr/sbin/sendmail -t'
Send an email from your Site Factory Drupal application to confirm you receive it:
- Navigate to admin/config/system/mailer/test to the Mailer test page
- Enter an email address in the Recipient field or leave this blank to send the email to your Drupal email.
- Click on the Send button.
- Confirm that you receive an email from the Site Factory site.
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.