Recently Browsing 0 members
No registered users viewing this page.
This is a lightweight alternative to other newsletter & newsletter-subscription modules.
It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
This module fits your needs if you...
...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns You can find it here: https://github.com/danielstieber/SubscribeToMailchimp
Let me know what you think and if I should add it to the Modules Directory.
Log into your Mailchimp account and go to Profile > Extras > API Keys. If you don't have an API Key, create a new one. Copy your API Key and paste it in the module settings (Processwire > Modules > Site > SubscribeToMailchimp). Back in Mailchimp, go to the list, where you want your new subscribers. Go to Settings > List name and defaults. Copy the List ID an paste it in to the module settings.
To use the module, you need to load it into your template:
$mc = $modules->get("SubscribeToMailchimp"); Now you can pass an email address to the module and it will try to edit (if the user exists) or create a new subscriber in your list.
$mc->subscribe('firstname.lastname@example.org'); You can also pass a data array, to add additional info.
$mc->subscribe('email@example.com', ['FNAME' => 'John', 'LNAME' => 'Doe']); You can even choose an alternative list, if you don't want this subscriber in your default list.
$mc->subscribe('firstname.lastname@example.org', ['FNAME' => 'John', 'LNAME' => 'Doe'], 'abcdef1356'); // Subscribe to List ID abcdef1356 If you want to unsubscribe a user from a list, you can use the unsubscribe method.
$mc->unsubscribe('email@example.com'); // Unsubscribe firstname.lastname@example.org from the default list $mc->unsubscribe('email@example.com', 'abcdef1356'); // Unsubscribe firstname.lastname@example.org from the list abcdef1356 If you want to permantly delete a user, you can call the delete method. Carefully, this step cannot be undone
$mc->delete('email@example.com'); // Permanently deletes firstname.lastname@example.org from the default list $mc->delete('email@example.com', 'abcdef1356'); // Permanently deletes firstname.lastname@example.org from the list abcdef1356
This module does not do any data validation. Use a sever-sided validation like Valitron Make sure that you have set up your fields in your Mailchimp list. You can do it at Settings > List fields and *|MERGE|* tags Example
Example usage after a form is submitted on your page:
// ... validation of form data $mc = $modules->get("SubscribeToMailchimp"); $email = $input->post->email; $subscriber = [ 'FNAME' => $input->post->firstname, 'LNAME' => $input->post->lastname, ]; $mc->subscribe($email, $subscriber);
In case of trouble check your ProcessWire warning logs.
I can't see the subscriber in the list
If you have enabled double opt-in (it is enabled by default) you will not see the subscriber, until he confirmed the subscription in the email sent by Mailchimp
I get an error in my ProccessWire warning logs
Check if you have the right List ID and API Key. Check if you pass fields, that exist in your list. Check if you pass a valid email address. Go to Mailchimps Error Glossary for more Information
How To Install
Download the zip file at Github or clone directly the repo into your site/modules If you downloaded the zip file, extract it in your sites/modules directory. You might have to change the folders name to 'SubscribeToMailchimp'. Goto the modules admin page, click on refresh and install it
Note: You can update safely from 0.0.1 without any changes in your code
Added 'Unsubscribe' method $mc->unsubscribe($email, $list = "") Added 'Delete' method $mc->delete($email, $list = "") Bug Fixes and compatibility changes
Removed type declarations to be compatible with PHP 5.1+* (thanks to wbmnfktr) Other
Changed the way, the base url for the api gets called *I have only tested it with PHP 7.x so far, so use on owners risk
As threatened in the Pub sub forum in the "What are you currently building?" thread, I've toyed around with Collabora CODE and built file editing capabilities for office documents (Libre-/OpenOffice formats and MS Office as well as a few really old file types) into a PW module.
If you are running OwnCloud or NextCloud, you'll perhaps be familiar with the Collabora app for this purpose.
Edit office files directly in ProcessWire
Edit your docx, odt, pptx, xlsx or whatever office files you have stored in your file fields directly from ProcessWire's page editor. Upload, click the edit icon, make your changes and save. Can be enabled per field, even in template context.
Currently supports opening and saving of office documents. Locking functionality is in development.
See the README on GitHub for installation instructions. You should be reasonably experienced with configuring HTTPS and running docker images to get things set up quickly.
Pull requests are welcome!
Here is a short demonstration:
By Robin S
An Images field allows you to:
Rename images by clicking the filename in the edit panel or in list view. Replace images, keeping metadata and filename (when possible) by dropping a new image on the thumbnail in the edit panel. Introduced here. But neither of these things is possible in File fields, which prompted this module. The way that files are renamed or replaced in this module is not as slick as in the Images field but it gets the job done. The most time-consuming part was dealing with the UI differences of the core admin themes. @tpr, gives me even more respect for the work that must go into AdminOnSteroids.
Most of the code to support the rename/replace features is already present in InputfieldFile - there is just no UI for it currently. So hopefully that means these features will be offered in the core soon and this module can become obsolete.
Files Rename Replace
Allows files to be renamed or replaced in Page Edit.
Install the Files Rename Replace module.
If you want to limit the module to certain roles only, select the roles in the module config. If no roles are selected then any role may rename/replace files.
In Page Edit, click "Rename/Replace" for a file...
Use the text input to edit the existing name (excluding file extension).
Use the "Replace with" select to choose a replacement file from the same field. On page save the file will be replaced with the file you selected. Metadata (description, tags) will be retained, and the filename also if the file extensions are the same.
Tip: newly uploaded files will appear in the "Replace with" select after the page has been saved.