Files
listmonk/models/messages.go
Kailash Nadh 67ad4d54ce Add external recipient support to /api/tx endpoint.
This patch introduces the long pending requirement of being able to send messages
to arbitrary recipients via the `/api/tx` endpoint without them having to be
subscribers in the database.

It maintains backwards compatibility and introduces just one new field,
`subscriber_mode` to the `/api/tx` endpoint.

- `default`  - Recipients must exist as subscribers in the database.
               Pass either `subscriber_emails` or `subscriber_ids`.                                                                                                                                                                     |

- `fallback` - Only accepts `subscriber_emails` and looks up subscribers in the
               database. If not found, sends the message to the e-mail anyway.
               In the template, apart from `{{ .Subscriber.Email }}`, other
               subscriber fields such as `.Name`. will be empty.
               Use `{{ Tx.Data.* }}` instead. |

- `external` - Sends to the given `subscriber_emails` without subscriber lookup
               in the database. In the template, apart from
               `{{ .Subscriber.Email }}`, other subscriber fields such as
               `.Name`. will be empty. Use `{{ Tx.Data.* }}` instead.                                                |
2025-11-28 16:37:20 +05:30

2.8 KiB