It turns out, sending an email to a group of subscribers is actually quite a hairy problem. One would think storing a set of emails, looping over each one of them and sending out emails is all that needs to be done. But this solution only works for a very small subscriber base(5-10 max). Any more, and you could be invoking the wrath of the email Gods - your emails could be classified as spam or worse, your domain could potentially be flagged! (Tag v1.0 of this project uses the naive approach.. Feel free to take a look if you are interested).
The solution is to use the services of a third-party provider like MailChimp that specializes in safe email transmission, and handles all the myriad requirements of bulk mailing.
This OctoberCMS plugin allows you to easily add a "Subscribe" button on your website. These subscribers get added to a "list" on MailChimp. The plugin also hooks into Rainlab Blog events, and allows subscribers to receive emails when a blog gets published (via MailChimp Campaigns - Each blog publish event results in the creation of a campaign)
Main features
- Uses MailChimp api V2.0
- Clean way to send subscribers an email using MailChimp
- unsubscription is easily handled by MailChimp
- Emails are sent out only when the status of the blog is set to published (on create or update)
Components
- Signup form - This allows users to enter their email address and click on the "Subscribe" button.
Requirements
- RainLab Blog plugin
- The from 'name' and from 'email address' are taken from your mail settings config.. So, please update these with valid values (config/mail.php).
See the Documentation tab for the usage details.
Icons made by "Freepik" from www.flaticon.com is licensed by CC 3.0
Installation
-
Go to Settings > "Updates & Plugins" page in the Backend.
-
Click on the "Install plugins" option.
-
Type Subscribe text in the search field, and pick the appropriate plugin.
-
To add the component on your front-end page/layout :
{% component 'Signup' %}
(if you want to use the component on a partial, drag the component onto your layout and move the code {% component 'Signup' %} into the partial. This way, the ajax framework will be able to find the required handlers.)
-
After logging into MailChimp, create a list for holding subscriber emails.
-
On your backend -> Settings, under the "Blog" category, an option for "MailChimp Subscription" becomes available. Please enter your MailChimp API key and List ID in the spaces provided.
-
You can customize the email that is sent out: navigate to backend->settings->mail->mail templates and modify the template named "serenitynow.subscribe::mail.email". ALL post data is available to the email template (user_id, title, slug, excerpt, content, content_html, published_at, published, created_at, updated_at)
Note: if you get an error message after applying 1.0.6, please delete the above mentioned email template. It should refresh automatically with the updated version.
-
Graham Willis
Found the plugin not useful on 29 Apr, 2018
I put "not useful" because of the lack of any support or proper instruction.
It wouldn't work "out of the box" and after 2 weeks of posting in Support without any response, I finally got it working sufficiently to cover my needs.
If you don't have experience troubleshooting plugins, I couldn't recommend this.
8-/
-
1.0.6 |
Fix October system class name change to MailSetting Sep 10, 2016 |
---|---|
1.0.5 |
Use MailSettings for getting email and name (instead of config) Sep 02, 2016 |
1.0.4 |
Add try-catch for MailChimp Errors in Plugin.php Aug 23, 2016 |
1.0.3 |
Change to uppercase Settings - Bugfix Aug 23, 2016 |
1.0.2 |
Fix include path for vendor (composer dependency) Aug 23, 2016 |
1.0.1 |
Initialize plugin. Aug 21, 2016 |