1. Bob Bloom
  2. CMandrill for Joomla
  3. Wednesday, 08 May 2013
  4.  Subscribe via email
Daniel,

I want to take a moment first to complement you on creating CMandrill, and for making it avaiable gratis.

After learning about Mandrill, I finally started using it today. Your component/plugin made it very easy to use Mandrill -- my contact form, for example.

I want to start using Mandrill -- and your wonderful component/plugin -- with my LaSalleMart ecomm extension. See my new Knowledge Base page at https://southlasalle.atlassian.net/wiki/display/lasallemartkb/Mandrill+for+your+email+send-outs.

My first use case with Mandrill is with Joomla's CLI. At the end of all the processing, I want to send an email.

I am successful sending the email with:

$mailer = JFactory::getMailer();
$mailer->setSender($from);
$mailer->addRecipient($to);
$mailer->setSubject($subject);
$mailer->setBody($subject);
$mailer->send();


Getting my CLI app to harness your wonderful component/plugin -- well, I'm having trouble. I am hoping you can help.

I'm doing variations of the following:

JPluginHelper::importPlugin('Mandrill');
JDispatcher::getInstance()->trigger('onAfterInitialise');
$mailer = JFactory::getMailer();
$mailer->setSender($from);
$mailer->addRecipient($to);
$mailer->setSubject($subject);
$mailer->setBody($subject);
$mailer->send();


Do I need to use "jimport('joomla.application.component.helper');" before "JDispatcher"?

Thank you for your help, Daniel.
-Bob Bloom
Responses (8)
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
Do you get any error in the console?
I haven't tried it myself, but your code looks fine...

Actually the plugin will look for the component's config (it needs the api key) and I'm not sure how this will work in a CLI environment.
You'll most probably have to make some die() in the plugin to see if it is at all being triggered.
Please if you use our extensions be so kind and review them at JED
Matukio | Hotspots Pro | CComment Pro
  1. more than a month ago
  2. CMandrill for Joomla
  3. # 1
Accepted Answer Pending Moderation
Daniel,

Thank you for your quick reply.

The plugin accesses the component's params to grab the key. So the CLI has to be aware of the component, so that your plugin can then grab it. Methinks!

I have failed in my mission getting your component and its plugin to work in my CLI. My CLI will have to work with the Mandrill API directly.

I succeeded having JMail's SMTP work with Mandrill, but the real power of Mandrill is its API. So I played with different variations of the PHP "wrappers" out there. Most of my variations failed, but some worked. When it worked, I really began to see the potential. Sometimes, do not underestimate the power of "Hello World"!

After all this fun, I'm mulling creating a library for Mandrill, so I can pretend that it's part of the native Joomla Platform. Instead of worrying about components and plugins, I can import CJMail from /library/cjmail akin to /library/joomla -- that's the theory! Then, I'll be able to call it in the same way in LaSalleMart. We'll see, but I'm probably not done with the "Hello World" experiments! I will keep you posted. Your component/plugin has inspired me!

-Bob
  1. more than a month ago
  2. CMandrill for Joomla
  3. # 2
Accepted Answer Pending Moderation
Daniel,

I published my Mandrill Library for Joomla -- for LaSalleMart! I have a specific use for Mandrill, so it's not quite a generic "standalone" creation. Hence, I won't be seeking JED listing for it.

With appreciation, I have attributed lib_mandrill to you in multiple places.

My blog post: http://blog.southlasallecommerce.com/2013/new-mandrill-library-for-lasallemart

My Knowledge Base page: https://southlasalle.atlassian.net/wiki/pages/viewpage.action?pageId=2457667

Free download -- see CREDITS.php: http://www.lasallemart.com/index.php/component/ars/repository/libmandrill


I must stress that my Mandrill Library is *NOT* a substitute for your excellent extension. In fact, I anticipate using both your extension and my library on the same site. Why? Because your extension will route new user notifications and any existing JMail sent email to Mandrill. My library will NOT similarly route. That's because you use a plugin event to "intercept" emails. My library has no such "interception" abilities.

Again, thank you Daniel!
  1. more than a month ago
  2. CMandrill for Joomla
  3. # 3
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
Hey Bob,
Thanks for the kind words and credit :blush:

You actually brought me to an idea. I actually don't understand why I didn't came to it earlier.

You are actually right - the Mandrill class should be a library. The plugin should do the "override" class stuff and it will use the library.

But having the class as a library will ensure that developers will be able to use the API if they need it.

Bob, get ready to be forked! :D:D:D

Cheers,
Daniel
Please if you use our extensions be so kind and review them at JED
Matukio | Hotspots Pro | CComment Pro
  1. more than a month ago
  2. CMandrill for Joomla
  3. # 4
Accepted Answer Pending Moderation
Daniel,

That does not sound entirely complimentary! I like the idea of saying "spoon" instead, although "Bob, be prepared to be spooned!" is not necessarily an improvement.

I am glad to have inspired.

Mainly, you'll be forking your own code! The one value-add I offer is my lib_mandrill works in my test CLI app.

Would you consider doing your "spoon" on GitHub.com? Then we can work on this together. Looking forward to it,
-Bob
  1. more than a month ago
  2. CMandrill for Joomla
  3. # 5
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
Yes, of course. CMandrill is already in a public repo on github:
https://github.com/compojoom/cmandrill

But it won't be any time soon I start on this... too much other stuff
Please if you use our extensions be so kind and review them at JED
Matukio | Hotspots Pro | CComment Pro
  1. more than a month ago
  2. CMandrill for Joomla
  3. # 6
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
Hey Bob,
Check the new CMandrill. It comes with the Cmandrill library: https://github.com/compojoom/lib_cmandrill - you could use it in your CLI scripts.

Cheers,
Daniel
Please if you use our extensions be so kind and review them at JED
Matukio | Hotspots Pro | CComment Pro
  1. more than a month ago
  2. CMandrill for Joomla
  3. # 7
Accepted Answer Pending Moderation
Daniel,

Thank you for letting me know about your update. Much appreciated!

I am leaning towards including your library with my Joomla distribution -- I just started on it with Joomla 3.2.0, calling it LaSalleCMS (http://LaSalleCMS.com).

Thank you for your further work on a Joomla-Mandrill integration. It is important work!

-Bob
  1. more than a month ago
  2. CMandrill for Joomla
  3. # 8
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Last questions

Errror on Google Captcha V3 in Matukio
Hi, I am experiencing spam-problems on contact-forms protected by google reCa...
0 Replies
Posted on Wednesday, 20 March 2024
  • New
  • Google map styles migrating......
    Google are updating their map styles. Is there anything we need to do to migrate...
    0 Replies
    Posted on Monday, 18 March 2024
    • #google maps
    • #map styles
    Latest Hotspots Makes Website Hang
    When using the Latest Hotspot module, the webpage slows down and does not load....
    3 Replies
    Posted on Monday, 15 January 2024
    Text ändern
    Hallo in der Übersicht der Veranstaltungen kann man ja auf "Mehr Informati...
    0 Replies
    Posted on Thursday, 14 March 2024
    When is CComment compatible with Joomla 5?
    When is CComment compatible with Joomla 5?...
    3 Replies
    Posted on Tuesday, 05 December 2023
    • #CComment
    • #Joomla 5