Skip to content

Commit

Permalink
Merge pull request #23 from cloudmitigator/fix-no-read-english
Browse files Browse the repository at this point in the history
Patch: Make email Subject line less awkward
  • Loading branch information
mcbanderson authored Apr 14, 2020
2 parents 30c5517 + de89ed9 commit fa74deb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion reflex_core/aws_rule.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
""" Module for the AWSRule class """
import logging
import os
import re

from reflex_core.notifiers import Notifier
from reflex_core.notifiers import SNSNotifier
Expand Down Expand Up @@ -118,7 +119,10 @@ def get_remediation_message_subject(self):
and must be less than 100 characters long in order to be compatible
with SNS. See https://docs.aws.amazon.com/sns/latest/api/API_Publish.html
"""
return f"The Reflex {self.__class__.__name__} was triggered."
subject = self.__class__.__name__
subject_split = re.split('(?=(?<=[a-z])[A-Z])|(?=[A-Z](?=[a-z])|(?=^[A-Z]))', subject)
fixed_subject = ' '.join(subject_split)
return f"The Reflex {fixed_subject} was triggered."

def add_pre_remediation_functions(self, functions):
"""
Expand Down

0 comments on commit fa74deb

Please sign in to comment.