You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/explanation/data-flow.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,14 +26,14 @@ Let's say the lambda runs a few tasks, which either pass (status `OK`) or fail (
26
26
27
27
## Phase 2: What Gets Published to SNS
28
28
29
-
We publish one SNS message per status type, so in this case two messages: one for `OK` and one for `ERROR`. Each message includes the relevant portion of the `_perform_task` return value (JSON-encoded) as the `Message` payload. The `result_type` is included as a `MessageAttribute` to allow for filtering by the SQS subscriptions.
29
+
We publish one SNS message per status type, so in this case two messages: one for `OK` and one for `ERROR`. Each message includes the relevant portion of the `_perform_task` return value, with a top-level `result_type` added before publication. The same `result_type` is also included as a `MessageAttribute` to allow for filtering by the SQS subscriptions.
@@ -77,8 +77,7 @@ The SQS event record (as seen by notifier Lambda) looks like:
77
77
78
78
## Phase 4: Notifier Parse Behavior with This Shape
79
79
80
-
The notifier parser converts the JSON string back into an object, and, if `result_type` is missing from the payload, injects it from the SQS `messageAttributes`. In this case, the payload doesn't include `result_type`, so it is injected.
81
-
80
+
The notifier parser converts the JSON string back into an object and validates that the payload `result_type` matches the SQS `messageAttributes.result_type` value when that attribute is present.
82
81
The result, which is fed to the notifier's templates, is:
Copy file name to clipboardExpand all lines: docs/how-to/set-up-ses.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,10 @@ Set up Amazon SES once per AWS account and region where your notifier Lambda run
12
12
13
13
* Choose the AWS account/region where email will be sent (SES setup is regional).
14
14
* Choose a sender identity:
15
+
15
16
* Email identity for one sender address.
16
17
* Domain identity if you want to send from multiple addresses in one domain.
18
+
17
19
* Make sure you can edit DNS records if you choose a domain identity.
18
20
19
21
SES requires verified identities for senders and (in sandbox) recipients. That means you must verify the email address or domain you want to send from, and if in sandbox, also verify any recipient addresses. Sandbox mode limits how much you can send, and you'll probably want to request production access if you want to send to more than one recipient.
Copy file name to clipboardExpand all lines: docs/how-to/write-lambda-and-templates.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Based on `examples/basic/lambda/lambda_module.py`:
33
33
34
34
* Key (`example`) is the `result_type`.
35
35
* Value (`{"message": "Hello World"}`) is the payload rendered by templates.
36
-
*The payload automatically has the key `result_type` injected by the notification handler, so you can access it in templates as `{{ result_type }}`.
36
+
*LambdaCron adds `result_type` to the published message body when it sends the payload to SNS, so you can access it in templates as `{{ result_type }}`.
37
37
38
38
## 2. Create templates that use the payload fields
39
39
@@ -90,7 +90,8 @@ At runtime:
90
90
91
91
Important detail:
92
92
93
-
*`result_type` is injected into the render payload by the notification handler when available in message attributes.
93
+
*`result_type` is injected into the message body by the publisher before it reaches the notifier.
94
+
* The SNS message attribute still carries the same `result_type`. It is used for filter policies and validation.
94
95
* That is why templates like `{{ result_type }}` work even when your `_perform_task` payload does not explicitly include a `result_type` field.
0 commit comments