Add ability to override SES region
This commit is contained in:
parent
5e696f36bf
commit
3e492e6310
@ -295,6 +295,15 @@ Lemur supports sending certificate expiration notifications through SES and SMTP
|
||||
See: `Using sending authorization with Amazon SES <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html>`_
|
||||
|
||||
|
||||
.. data:: LEMUR_SES_REGION
|
||||
:noindex:
|
||||
|
||||
Specifies a region for sending emails via SES.
|
||||
|
||||
.. note::
|
||||
This parameter defaults to us-east-1 and is only required if you wish to use a different region.
|
||||
|
||||
|
||||
.. data:: LEMUR_EMAIL
|
||||
:noindex:
|
||||
|
||||
|
@ -61,7 +61,10 @@ def send_via_ses(subject, body, targets):
|
||||
:param targets:
|
||||
:return:
|
||||
"""
|
||||
client = boto3.client("ses", region_name="us-east-1")
|
||||
ses_region = current_app.config.get("LEMUR_SES_REGION")
|
||||
if not ses_region:
|
||||
ses_region = "us-east-1"
|
||||
client = boto3.client("ses", region_name=ses_region)
|
||||
source_arn = current_app.config.get("LEMUR_SES_SOURCE_ARN")
|
||||
args = {
|
||||
"Source": current_app.config.get("LEMUR_EMAIL"),
|
||||
|
Loading…
Reference in New Issue
Block a user