# slz_gdpr_email_sender Lambda

`slz_gdpr_email_sender` lambda sends email messages back to AE depending on a result of flow execution.
It could receive event from s3->sns/sns. samples could be found in [/events](./events)

## Lambda Environment variables
To execute the slz_gdpr_email_downloader lambda the following environment variables must be configured:

| Variable                 | Description                        
|--------------------------|------------------------------------
| `ENVIRONMENT`            | Environment name (`prod`, `dev`)   
| `SENDER`                 | email to set as From:             
| `SENTRY_SECRET_KEY`      | Path to Sentry secrets

## Lambda Input
See [/events](./events)


## Lambda Output
In case of successful lambda execution the following output will be provided:
```json
{
    "meta": {
      "status": "OK",
    }
}
```
In case of any failure we fail lambda so event won't be lost and stored to DLQ

## Local testing

- Prepare CloudWatch event
- Put it into the `events/`
- Edit __main__.py to use added CW event(if you use IDE)
- Execute lambda:

```
    python slz_gdpr_email_sender -e <environment> -p <event>.json
```
