Newsletter plugin (sort of)

Since it would not be possible to leave the page while an js-ajax-send-email-progress-bar-thingy is running, an external provider sounds like the only option to have something reliable.

I remember a wordpress plugin which has a background send, progress and abort functionality, guess I need to dig into that. :smile:

I will come back to your offer, thanks! :smile:

Mandrill is sweet. +1 for a Kirby email list plugin that integrates with Mandrill. And I believe that Mandrill even has a statistics API, in which case there’d be the source of stats to then feed into a Kirby widget - just a thought.

1 Like

@FabianSperrle, I developed a basic modular e-mail setup in K2 awhile ago that utilized sendgrid API. It was very easy to work with, though it never ended up getting used. It allowed the use of different headers, footers and body content and assembled all the html/css before sending. The demo was deploying a single e-mail at a time and wasn’t finished. The idea got shot down before I took it any further. If you’d like I can send you the contents though.

Hey everybody,

I tried to rewrite the plugin from scratch and I guess it’s much better now.
Some of the ideas that were proposed in the forum have been implemented, thank you all. :smile:

Here’s some changes:

  • no more background processing with shell_exec()
  • all recipients are native Kirby users now
  • subscribe and unsubscribe form added
  • all recipients will be added to bcc: in the email (this should be ok for smaller recipients-lists)
  • added a widget (min. req. Kirby 2.0.7) to list the latest 5 children of page blog (please adapt if necessary)

What’s not working until now:
site()->user($username)->delete(); is not working in unsubscribe.php line 29.
I have no idea why.
fixed.

@Luke Sure, that would be great! Do you have it up on GitHub or somewhere?

@andi242:
Thank you very much.

My test on my DEV XAMPP on Win7 first had some errors.
After some time I found, that you sometimes have used the short PHP-Tag <? instead of the longer PHP-Tag <?PHP .
<?= should be <?PHP echo , but I don’t know whether you use this.

If you change that, it can run on all webservers.

1 Like

thank you @HeinerEF I will check this :smile:

Can you specify the PHP/Apache versions?
Since this method is used by kirby itself, I am not sure if this is an issue.

Or is it just the php tag at the beginning of a file?

As you can read at HowTo: Start Kirby development on a PC I use as my DEV system:

  • XAMPP Version 1.8.2-5
  • Apache 2.4.9
  • PHP 5.4.27 (VC9 X86 32bit thread safe) + PEAR

For details look at Example #2 PHP Opening and Closing Tags, the first Note!

But keep in mind that Kirby runs on PHP 5.3 (Requirements).


You use it often within of your php files, not at the beginning.

@anon77445132: You can enable short tags via your php.ini or in your .htaccess.

Yes I know that.
But I prefer to create portable code, if that is possible.
The effort here is minimal and therefore I would never give it up.

My first attempts led to errors which I could not solve immediately. Hence my reference here.

1 Like

I agree with @HeinerEF here. I started writing short tags in template examples in Kirby 1 but soon realized that not every user is able to modify the PHP.ini settings and switch to short tags. So I’d always prefer to write any plugin or extension with regular tags just for a more global compatibility.

3 Likes

I will change that, thanks for the feedback :wink:

Hi,
can you provide an exmaple (with fake data) on how to fill the config.php?

//c::set('phpmailer_path', '');
c::set('phpmailer_host', '');
c::set('phpmailer_user', '');
c::set('phpmailer_passwd', '');
//c::set('phpmailer_phpbin', '');
//c::set('phpmailer_localpath', '');
//c::set('phpmailer_logfile', '');
//c::set('phpmailer_page', '');
c::set('phpmailer_blog', ''); // set your blog root here for post selection
c::set('phpmailer_from', '');
c::set('phpmailer_fromName', '');
c::set('phpmailer_ReplyTo', '');
c::set('phpmailer_ReplyToName', '');
//c::set('phpmailer_', '');
//c::set('phpmailer_', '');

Thanks!

Hi! This should do. :slight_smile:
No need to use all of those parameters.

To be honest, I did not develop this plugin for quite a while. So this may be quite buggy. :wink:

/* -----------------  newsletter  config ---------------------- */

//c::set('phpmailer_path', '');
c::set('phpmailer_host', 'smtp.gmail.com');
c::set('phpmailer_user', 'the.gmail-email@gmail.com');
c::set('phpmailer_passwd', 'gmail-password');

//c::set('phpmailer_phpbin', '');
//c::set('phpmailer_localpath', '');
//c::set('phpmailer_logfile', '');
//c::set('phpmailer_page', '');
c::set('phpmailer_blog', 'top-page-of-yourblog-you-want-to-use-this-for');
c::set('phpmailer_from', 'the.gmail-email@gmail.com');
c::set('phpmailer_fromName', 'Display Name');
c::set('phpmailer_ReplyTo', 'reply-to-email@gmail.com'');
c::set('phpmailer_ReplyToName', 'Reply to Display Name');

Is it possible that in the https://github.com/andi242/kirbycms-newsletter-addon on Github I miss the blueprints?

@tutchi Don’t you trust your eyes :wink:?

I see. Sorry. :slight_smile:
Thanks for your time.

@tutchi, I guess you don’t need a blueprint for these pages apart from the default one, that’s probably why there was none added.

Indeed. No Blueprints needed.

I just release an alpha version of my mailjet plugin for kirby. maybe you guys want to give me some feedback? I would appreciate it very much. Thanks.