Newsletter Plugin provides a subscription functionality in order to subscribe to a newsletter.
Use modman package manager to install the plugin.
From the Grav CMS project directory perform the commands
modman init
modman clone [email protected]:mcspronko/grav-plugin-newsletter.git
As a result, the Newsletter plugin should appear under user/plugins/newsletter directory.
There are two ways on how you can add new subscriber to the system.
Navigate to the Admin -> Newsletter -> Audience page and click the "Add Subscriber" button. Fill in all required fields and hit the "Save" button.
In order to add a new subscriber, create a new Markdown file under <project_root>/user/data/newsletter/subscribers directory.
---
name: Max Pronko
email: [email protected]
is_subscribed: 1
created: 2019-07-10 11:10:03
---
From Admin -> Newsletter page you will see new subscriber record.
In order to create new campaign, navigate to the Admin -> Newsletter -> Campaigns page and click the "Create Campaign" button.
form:
name: newsletter
action: /subscribe.json
fields:
-
name: email
size: field-size
outerclasses: field-position
placeholder: 'Your Email Here'
type: email
validate:
required: true
buttons:
-
type: submit
classes: 'button submit'
value: Subscribe
process:
-
subscribe:
fileprefix: subscriber-
dateformat: Ymd-His-u
extension: txt
body: '{% include ''forms/data.txt.twig'' %}'
-
message: 'Thank you for your subscription!'