AWS SES host list out of date

Your software
My Mautic version is: V2.16.1
My PHP version is: 7.3.14

Your problem
My problem is: The email-smtp.eu-west-2.amazonaws.com SES host is missing from the list available.

These errors are showing in the log: n/a

Steps I have tried to fix the problem: I’ve found this in bundles/EmailBundle/Form/Type/ConfigType.php

$builder->add(
            'mailer_amazon_region',
            'choice',
            [
                'choices'     => [
                    'email-smtp.eu-west-1.amazonaws.com' => 'mautic.email.config.mailer.amazon_host.eu_west_1',
                    'email-smtp.us-east-1.amazonaws.com' => 'mautic.email.config.mailer.amazon_host.us_east_1',
                    'email-smtp.us-west-2.amazonaws.com' => 'mautic.email.config.mailer.amazon_host.eu_west_2',
                ],
                'label'       => 'mautic.email.config.mailer.amazon_host',
...

Can I just add the missing host key to that list? If so, what should the value be?

Also: it looks as if there’s a typo in that code anyway. The last key - us-west-2 - has a value of ...eu_west_2, which seems odd. Could I just change the third choice key to eu rather than us?

A simple patch seems to fix this. I also had to update translations/en_GB/EmailBundle/messages.ini

Mautic team: if you’d like a PR for this against 2.16.2, let me know.

Patch:

diff --git a/bundles/EmailBundle/Form/Type/ConfigType.php b/bundles/EmailBundle/Form/Type/ConfigType.php
index 16d58d2..bbc2211 100755
--- a/bundles/EmailBundle/Form/Type/ConfigType.php
+++ b/bundles/EmailBundle/Form/Type/ConfigType.php
@@ -323,8 +323,9 @@ class ConfigType extends AbstractType
             [
                 'choices'     => [
                     'email-smtp.eu-west-1.amazonaws.com' => 'mautic.email.config.mailer.amazon_host.eu_west_1',
+                    'email-smtp.eu-west-2.amazonaws.com' => 'mautic.email.config.mailer.amazon_host.eu_west_2',
                     'email-smtp.us-east-1.amazonaws.com' => 'mautic.email.config.mailer.amazon_host.us_east_1',
-                    'email-smtp.us-west-2.amazonaws.com' => 'mautic.email.config.mailer.amazon_host.eu_west_2',
+                    'email-smtp.us-west-2.amazonaws.com' => 'mautic.email.config.mailer.amazon_host.us_west_2',
                 ],
                 'label'       => 'mautic.email.config.mailer.amazon_host',
                 'required'    => false,

Hi there,

This is already being discussed in a PR here which proposed to convert it to a text field, please do add your voice:

As a side note any pull requests should be based on the 3.x branch.