
Problem/Motivation
We’re currently hardcoding our CSS in our email.html.twig
https://www.drupal.org/docs/contributed-modules/drupal-symfony-mailer/ge...
The documentation states we’re better of using a library called email in our active theme.
This will be used in
class DefaultsEmailAdjuster extends EmailAdjusterBase {
/**
* {@inheritdoc}
*/
public function build(EmailInterface $email) {
$theme = $email->getTheme();
$email->setSender('<site>')
->addTextHeader('X-Mailer', 'Drupal')
->addLibrary("$theme/email");
if ($default_transport = MailerTransport::loadDefault()) {
$email->setTransportDsn($default_transport->getDsn());
}
}
}
Proposed resolution
Move the CSS out of the template in to a library.
Issue fork socialbase-3406149
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3406149-symfony-mailer--
changes, plain diff MR !191
Comments
Comment #3
ronaldtebrake CreditAttribution: ronaldtebrake as a volunteer and at Open Social for Open Social commentedComment #4
ronaldtebrake CreditAttribution: ronaldtebrake as a volunteer and at Open Social for Open Social commentedComment #5
ronaldtebrake CreditAttribution: ronaldtebrake as a volunteer and at Open Social for Open Social commentedFor now we're trying a different route, as this has issues with the customizability of the theme using the color module and others.