lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
172 stars 94 forks source link

Implemented a possibility to enable email newsletters subscription by using Listmonk #143

Closed n0rdy closed 8 months ago

n0rdy commented 9 months ago

Here are the configs required to add to the config.toml/hugo.toml file:

    # Listmonk
    listmonk = true 
    listmonk_host = "https://listmonk.your_domain.tld"
    listmonk_subscription_list_uiid = "YOUR_NEWSLETTERS_LIST_UIID"
    listmonk_subscription_form_text = "Subscribe to my newsletters"                # default: Subscribe to my newsletters
    listmonk_subscription_success__message = "Thanks for subscribing"         # default: Thanks for subscribing
    listmonk_subcription_error_message = "Something went wrong"                  # default: Sorry, something went wrong. Please, try again

Here is how it looks for the dark theme: CleanShot 2023-10-15 at 22 15 53

and for the light one: CleanShot 2023-10-15 at 22 17 50

It is also added to the About page:

The way it looks when the error happens:

On successful subscription:

lukeorth commented 9 months ago

Thanks, @n0rdy! This looks like a great addition. I will try to review it soon. :slightly_smiling_face:

lukeorth commented 9 months ago

I don't have listmonk, so my testing capability is limited. That said, it looks like a really neat service. I like that it's an open-source, self-hosted solution -- definitely fits with the theme.

Since I don't have a listmonk instance, I could only test that the error message works. :stuck_out_tongue_winking_eye: If you're able to test that it works successfully though, I'll take your word for it.

If you wouldn't mind adding this new feature to the README too, I'd greatly appreciate it. Then, if all the development is complete, I can get it merged. Thanks again!

n0rdy commented 9 months ago

Since I don't have a listmonk instance, I could only test that the error message works. 😜 If you're able to test that it works successfully though, I'll take your word for it.

If you want, I can share via PM a URL to my Listmonk self-hosted instance and a test newsletters id, so you can use those values in order to get the successful response.

Alternatively, if you want, I can share some links on how to setup Listmonk on DigitalOcean. The key challenge there (for me) was setting up CORS for multiple domains within nginx =)

If you wouldn't mind adding this new feature to the README too, I'd greatly appreciate it.

Added. Please, feel free to suggest any changes there, as English is not my mother tongue.

lukeorth commented 8 months ago

Thank you, @n0rdy -- I managed to get Listmonk setup on a DigitalOcean droplet and test the changes. It works great!

Thank you for adding a description of it to the README too. I think others will really benefit from this feature. :tada: