# Tempmailer Impact

Tempmailer Impact is the email template server for the `impact.obtainly.com` / one-app / infra experience.

It is intentionally separate from the distro and retail mailers:

- `tempmailer-distro` serves distro-context templates
- `tempmailer-retail` serves retail-context templates
- `tempmailer-impact` serves one-app / infra / impact templates

## What this repo covers

This mailer is used for Impact-specific communication around:

- onboarding and login emails
- password resets and OTPs
- credit and repayment notices
- intervention lifecycle notifications
- transfer and payout updates
- conversations and messaging
- approval-flow related emails
- compliance and business document requests

## Local setup

Add this host entry:

```bash
127.0.0.1 tempmailer-impact.local
```

Then start the container:

```bash
docker-compose up -d
```

Visit:

```text
http://tempmailer-impact.local
```

## Template usage

Templates are rendered from `src/index.php` with a `template` query parameter and JSON `parameters` payload.

Examples of template families already in this repo:

- `signup`
- `migration_notification`
- `conversation_message`
- `credit_request_*`
- `credit_request_pre_approval`
- `credit_request_post_approval`
- `credit_check_*`
- `installment_*`
- `payment_*`
- `bank_statement_*`
- `insurance_*`
- `mandate_*`
- `guarantor_*`
- `request_business_document`
- `monthly_payment_report`
- `report_*`

One-app / Impact-specific flows also include:

- intervention lifecycle emails
- tranche and transfer notifications
- organisation approval flow notifications
- beneficiary and account update alerts

## Impact-specific direction

Impact templates should reflect the one-app product, not the retail or distro UI.

That means the copy should stay aligned with:

- business and approval workflows used by one-app
- intervention and tranche operations
- transfer and settlement notifications
- organisation-level approval flows

If a new backend flow is added in `obtainly-core`, this repo should get a matching template family so the mailer stays product-specific.
