linderp / sulu-mailing-list-bundle
Mailing List Bundle for Sulu CMS
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:symfony-bundle
pkg:composer/linderp/sulu-mailing-list-bundle
Requires
- php: ^8.2
- jackalope/jackalope-doctrine-dbal: ^2.0
- linderp/sulu-base-bundle: ^0.1 || dev-main
- linderp/sulu-form-save-contact-bundle: ^0.1
- sulu/sulu: ^2.6
- symfony/config: ^6.2 | ^7.0
- symfony/dependency-injection: ^6.2 | ^7.0
- symfony/framework-bundle: ^6.2 | ^7.0
- symfony/http-foundation: ^6.2 | ^7.0
- symfony/http-kernel: ^6.2 | ^7.0
- symfony/intl: ^6.2 | ^7.0
- symfony/security-core: ^6.3 | ^7.0
- symfony/translation: ^6.2 | ^7.0
README
Sulu bundle that enabled to save contacts within mailing list, craft and send mails to those registered for a mailing list
Installation
This bundle requires PHP 8.2 and Sulu 2.6 and the following packages:
- linderp/sulu-form-save-contact-bundle
- linderp/sulu-base-bundle
- Open a command console, enter your project directory and run:
composer require linderp/sulu-mailing-list-bundle
If you're not using Symfony Flex, you'll also need to add the bundle in your config/bundles.php file:
return [ //... Linderp\SuluMailingListBundle\SuluMailingListBundle::class => ['all' => true], ];
- Register the new routes by adding the following to your
routes_admin.yaml:
SuluMailingListBundle: resource: "@SuluMailingListBundle/Resources/config/routes_admin.yml"
- If you don't have the mjml api key already, get your key here.
- Add the file
config/packages/sulu_mailing_list.yamlwith the following configuration and replace #your key here with your actual key:
sulu_mailing_list: mjml: app_id: <api-id> secret_key: <secret-key> caching: true no_reply_email: <no-reply-mail>
For development purposes you can deactivate caching. By default, it is enabled.
5. Reference the frontend code by adding the following to your assets/admin/package.json:
"dependencies": { "sulu-index-now-bundle": "file:../../vendor/linderp/sulu-mailing-list-bundle/Resources/js" }
- Import the frontend code by adding the following to your
assets/admin/app.js:
import "sulu-mailing-list-bundle";
- Build the admin UI:
cd assets/admin
npm run build
Additional Setup
Fonts
To add a new Font for the admin to use add a class implementing MailFontInterface, eg:
class MomoMailFont implements MailFontInterface { public function getConfiguration(): MailFontConfiguration { return new MailFontConfiguration( '<url to momo.css>', //css file place it somewhere in your /public folder 'Momo Trust Sans', // display name 'Momo Trust Sans, sans-serif', //font-family that is applied within mjml files true ); } }
Either provide the css yourself or use a service like google fonts. The css file could look as follows:
@font-face { font-family: 'Momo Trust Sans'; font-style: normal; font-weight: 400; src: url(momo-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }