Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • project/amazon_ses
  • issue/amazon_ses-3199493
  • issue/amazon_ses-3250870
  • issue/amazon_ses-2570147
  • issue/amazon_ses-3265114
  • issue/amazon_ses-3272810
  • issue/amazon_ses-3273373
  • issue/amazon_ses-3278501
  • issue/amazon_ses-3316452
  • issue/amazon_ses-3346554
  • issue/amazon_ses-3363913
  • issue/amazon_ses-3416368
  • issue/amazon_ses-3417090
  • issue/amazon_ses-3446166
  • issue/amazon_ses-3450865
  • issue/amazon_ses-3454004
  • issue/amazon_ses-3466077
  • issue/amazon_ses-3466095
  • issue/amazon_ses-3466096
  • issue/amazon_ses-3506259
  • issue/amazon_ses-3506500
  • issue/amazon_ses-3446425
  • issue/amazon_ses-3508814
  • issue/amazon_ses-3460056
24 results
Show changes
Commits on Source (3)
<?php
/**
* @file
* Hooks for the amazon_ses module.
*/
/**
* Implements hook_queue_info_alter().
*/
function amazon_ses_queue_info_alter(&$queues) {
$enabled = \Drupal::config('amazon_ses.settings')->get('queue');
if (!$enabled && isset($queues['amazon_ses_mail_queue']['cron'])) {
unset($queues['amazon_ses_mail_queue']['cron']);
}
}
...@@ -4,7 +4,6 @@ namespace Drupal\amazon_ses\Plugin\Mail; ...@@ -4,7 +4,6 @@ namespace Drupal\amazon_ses\Plugin\Mail;
use Drupal\amazon_ses\AmazonSesHandlerInterface; use Drupal\amazon_ses\AmazonSesHandlerInterface;
use Drupal\amazon_ses\MessageBuilderInterface; use Drupal\amazon_ses\MessageBuilderInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Mail\MailInterface; use Drupal\Core\Mail\MailInterface;
use Drupal\Core\Mail\Plugin\Mail\PhpMail; use Drupal\Core\Mail\Plugin\Mail\PhpMail;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
...@@ -23,7 +22,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; ...@@ -23,7 +22,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
class AmazonSes extends PhpMail implements MailInterface, ContainerFactoryPluginInterface { class AmazonSes extends PhpMail implements MailInterface, ContainerFactoryPluginInterface {
public function __construct( public function __construct(
protected ConfigFactoryInterface $configFactory, protected $configFactory,
protected AmazonSesHandlerInterface $handler, protected AmazonSesHandlerInterface $handler,
protected MessageBuilderInterface $messageBuilder, protected MessageBuilderInterface $messageBuilder,
protected QueueFactory $queueFactory, protected QueueFactory $queueFactory,
...@@ -50,9 +49,11 @@ class AmazonSes extends PhpMail implements MailInterface, ContainerFactoryPlugin ...@@ -50,9 +49,11 @@ class AmazonSes extends PhpMail implements MailInterface, ContainerFactoryPlugin
* {@inheritdoc} * {@inheritdoc}
*/ */
public function mail(array $message) { public function mail(array $message) {
if ($this->config->get('override_from') || !isset($message['from'])) { $config = $this->configFactory->get('amazon_ses.settings');
$name = $this->config->get('from_name');
$address = $this->config->get('from_address'); if ($config->get('override_from') || !isset($message['from'])) {
$name = $config->get('from_name');
$address = $config->get('from_address');
$message['from'] = "$name <$address>"; $message['from'] = "$name <$address>";
} }
......