diff --git a/moto/ses/template.py b/moto/ses/template.py index ec34cd19c..5c82c6091 100644 --- a/moto/ses/template.py +++ b/moto/ses/template.py @@ -10,7 +10,8 @@ def parse_template(template, template_data, tokenizer=None, until=None): for char in tokenizer: if until is not None and (char + tokenizer.peek(len(until) - 1)) == until: return parsed - if char == "{": + if char == "{" and tokenizer.peek() == "{": + # Two braces next to each other indicate a variable/language construct such as for-each tokenizer.skip_characters("{") tokenizer.skip_white_space() if tokenizer.peek() == "#": diff --git a/tests/test_ses/test_templating.py b/tests/test_ses/test_templating.py index 0883013b0..a9346b3a9 100644 --- a/tests/test_ses/test_templating.py +++ b/tests/test_ses/test_templating.py @@ -24,3 +24,10 @@ def test_template_with_multiple_foreach(): "l2": [{"o1": "ob1", "o2": "ob2"}, {"o1": "oc1", "o2": "oc2"}], } parse_template(t, kwargs).should.equal(" - it1 - it2 and list 2 ob1 ob2 oc1 oc2 ") + + +def test_template_with_single_curly_brace(): + t = "Dear {{name}} my {brace} is fine." + parse_template(t, template_data={"name": "John"}).should.equal( + "Dear John my {brace} is fine." + )