abertschi / postcards

A CLI for the Swiss Postcard Creator :postbox:
https://abertschi.ch/blog/2022/receiving-postcards/
MIT License
36 stars 8 forks source link

Config: Separate recipient from config #17

Open matbech opened 6 years ago

matbech commented 6 years ago

My use case is one post account with multiple recipients. Hence, it would be nice if the recipient config could be separated from the account/sender config file. Possibly, in a "address book" like config file. --account "account.conf" --recipient "recipient.conf" This way I don't have to duplicate the account/sender information in every config file.

abertschi commented 6 years ago

Please be aware that the terminology for account is a https://postcardcreator.post.ch/ account, whereas sender is the sender of the postcard.

Instead of 2 new flags, we should add a single one to overwrite/ set the recipient of the postcard. One can send postcards to multiple recipients by issuing postcards with different --recipient-files

The following steps are a sound approach to me:

I flagged this as a feature so we can cover it the next major release.

If your usecases require more sophisticated, "address book" like functionality, i suggest you use the Rest API wrapper directly https://github.com/abertschi/postcard_creator_wrapper.

abertschi commented 6 years ago

Until then, you could create a small script that generates aconfig.json on the fly by including recipients from different files based on input flags.