Setup newsletter plugin

Hi,

I found this newsletter plugin https://github.com/mcspronko/grav-plugin-newsletter
But I am new to grav and not quite sure how to set it up. Got it running in the admin panel but I have no idea how to integrate the form in the client page.

Would be great if anyone can help me with that! :slight_smile: Sadly there is zero documentation for this plugin…

Hi, in principle after you activated the Newsletter plugin, you need to set up a page like https://learn.getgrav.org/forms/forms/example-form . The frontmatter in our case looks like

—yaml
title: Newsletter

form:
fields:
- name: name
label: Name
placeholder: Enter your name
autofocus: on
autocomplete: on
type: text
validate:
required: true

    - name: email
      label: Email
      placeholder: Enter your email address
      type: email
      validate:
        required: true 

buttons:
    - type: submit
      value: Submit
    - type: reset
      value: Reset

process:
    - subscribe:
        filename: newsletter.txt
        operation: add

Note the `subscribe` action. Maybe you need to adjust the settings a bit, since I haven't tested it.

Concerning the plugin, consider it as "pre-alpha" release, since it is not included in the GPM and thus may contain some bugs or even security issues... Further although recently created, it seems to be abandoned for me.

I second Sommerregen, would be nice to have such plugin well documented and in the GPM.

Currently I would just use (and I do use myself) some JS from a service that provides newsletters and a js-based form collection which automates the opt-in. You add it to the theme’s twig, and you’re set.

Hi, thanks for the answers! :slight_smile:
Yep, I also thought using something like Mailchimp would be better for now. But thanks Sommerregen for the great explanation, helped me to better understand grav! :slight_smile: