Turn visitors into subscribers. Eliminate manual entry of subscribers with signup forms that sync directly with your Get a Newsletter account.
- Create and manage newsletter forms directly in WordPress
- Add forms using the block editor (Gutenberg)
- Customize form appearance with colors and styles
- Add forms using widgets in sidebars or footer
- Add forms using shortcodes in posts or pages
- Support for both embedded and popup forms
- Multiple forms can be used on the same page
- Available in English and Swedish
For the official WordPress plugin documentation, see readme.txt.
- PHP 7.2 or higher
- WordPress 5.2 or higher
- Node.js and npm for building block editor components
- Composer for PHP dependencies
- Clone the repository
git clone git@github.com:getanewsletter/wp-get-a-newsletter.git
cd wp-get-a-newsletter
- Install JavaScript dependencies and build block editor components
cd blocks
npm install
npm run build
- For development, start the dev server from while standing in the
blocks
-folder:
npm run start
getanewsletter/
├── assets/ # CSS, JS, and images
├── blocks/ # Gutenberg block components
│ ├── src/ # Block source code
│ └── build/ # Compiled block files
├── languages/ # Translation files
├── GAPI.class.php # API integration class
├── getanewsletter.php # Main plugin file
├── readme.md # This file (for GitHub)
├── readme.txt # WordPress.org plugin repository file
└── subscribe.php # Form submission handling
The plugin uses WordPress' translation system and supports translations for both PHP and JavaScript code. We use POEdit for managing translations.
-
Generate/Update POT file
wp i18n make-pot . languages/getanewsletter.pot
This creates/updates the template file containing all translatable strings from both PHP and JavaScript.
-
Edit Translations using POEdit
- Open POEdit
- Go to File > Open
- Navigate to the
languages/getanewsletter-sv_SE.po
file and open it - Go to Translation > Update from POT file...
- This will update the list of translated strings with the new ones
- Translate all new strings
- Save the file (this automatically creates the .mo file)
-
Generate JSON files for JavaScript translations
wp i18n make-json languages/ --no-purge
This creates JSON files required for JavaScript translations.
After completing the translation process, you should have these files in your languages
directory:
languages/
├── getanewsletter.pot # Template file
├── getanewsletter-sv_SE.po # Swedish translation source
├── getanewsletter-sv_SE.mo # Swedish translation compiled
└── getanewsletter-sv_SE-[hash].json # Swedish translation for JavaScript
- Set your WordPress site language to the translated locale
- Check both admin and frontend areas
- Verify translations in:
- PHP strings (forms, admin pages)
- JavaScript strings (block editor, dynamic content)
- Error messages and notifications
- Always start with the latest .pot file
- Create new .po file with correct locale code
- Translate all strings
- Save to generate .mo file
- Generate JSON files
- Test thoroughly
- Commit all translation files (.po, .mo, and .json)
Before submitting a pull request, please ensure:
- Your code follows WordPress coding standards
- All JavaScript is properly built (
npm run build
) - No PHP errors or warnings are introduced
- Translations are up to date
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the GPL v2 or later - see the LICENSE file for details.