knadh / listmonk

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
https://listmonk.app
GNU Affero General Public License v3.0
14.49k stars 1.32k forks source link

[api] test email for campaign api requires all parameters #1948

Open iloveitaly opened 1 month ago

iloveitaly commented 1 month ago

Version:

Description of the bug and steps to reproduce: The /test endpoint seems to require all params that the creation endpoint does. Just passing subscribers returns a validation error.

I ran into this when building https://github.com/iloveitaly/listmonk-newsletter

knadh commented 1 month ago

This is by design. This allows the campaign to be tested before it’s saved to the DB. Having to save every change to the DB only to test it is not ideal.

iloveitaly commented 1 month ago

Got it, that case makes sense.

Does this apply to after the campaign is created and persisted to the DB? Would be better for users if only subscriptions is required to send test emails if the campaign has already been fully created.

The docs state that only subscriptions is required, so I can submit a PR to better document this functionality.

knadh commented 1 month ago

Yep, it always takes the inputs from the form, saved or unsaved, to send the test. Please do send a PR to fix the docs. Thank you.