netflex/newsletter-foundation

Templates and components for Netflex Newsletters

v1.0.10 2024-08-23 07:56 UTC

README

The documentation and features are a work in progress!

Boilerplate with tested markup for newsletters and components for easy integration with Netflex marketing.

Installation

Install with composer, using composer require netflex/newsletter-foundation Package will be installed with standard components, and without header and footer.

Edit config

To edit config, first copy the config file to your project using php artisan vendor:publish --tag=config The config can then be found in config/newsletter-foundation.php The config is documented with context for the different settings.

Setting up templates and components in Netflex

To register the default template in Netflex, use the artisan command php artisan nnf:register:template (not implemented yet) This will create a view in resources/views/newsletters and register it in Netflex as the default newsletter template.

To register all components in the package in Netflex, use the command php artisan nnf:register:components (not implemented yet) Please note that component images must be added manually in netflex, as adding this via API is not supported.

To register a template manually that uses the foundation template, add a view in your resources/views/newsletters folder with the following content:

@include('netflex-newsletter-foundation::templates.foundation')

This includes the foundation template from the package. You can then register the template as normal in Netflex.

You may also extend the foundation layout using

@extends('netflex-newsletter-foundation::layouts.foundation')

If you want to register one of the package components inside netflex, you should use the prefix netflex-newsletter-foundation:: as a part of the path, in example netflex-newsletter-foundation::one-column

Remember to fill the code-field with "newsletter_component" on all components registered in netflex, and on all block builder areas added to a newsletter template to filter out these components from page builder templates.

Base components

The base components are foundation blocks that are used as building blocks inside components. These can not be added directly as an editable component.

Default components

The following components are included as default:

Customizing default components

You may publish the assets to your project using the command php artisan vendor:publish --tag=views This will copy templates, layouts and components to resources/views/vendor/netflex-newsletter-foundation

Extending

To implement your own components, you may reuse the existing anonymous base components with the netflex-newsletter-foundation:: prefix when using a component from your project, in example <x-netflex-newsletter-foundation::default-content /> For using class components, use x-netflex-newsletter-foundation- , in example <x-netflex-newsletter-foundation-image />