1. Walter White
  2. Newbie Area
  3. Thursday, 27 June 2013
  4.  Subscribe via email
Hi Daniel - I am developing a custom Joomla component for a client, and would like to send transactional emails (subscriptions to event updates, etc.) with this custom component. With the CMandrill component installed and the plug-in enabled, the component will not send emails. That could be due to the email configuration (SMTP) used for Mandrill.

I contacted the folks at mandrill.com, and they suggested I seek your help. I created a template in the CMandrill component, and linked it to the component, yet no emails send. If I create a from in RSForm!Pro, it will send an email through the Mandrill API.

Any ideas on how I can enable my component to send these emails successfully?
Responses (10)
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
If the plugin is enabled we don't use the SMTP configuration, but the mandrill API.

Do you use:

$mail = JFactory::getMailer();
$mail->send(....);


or how do you exactly send your mails?

Also try to have the plugin ordered first in the plugin list (first for system tasks).

That is what pops up into my head right now.

Regards,
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. Newbie Area
  3. # 1
Accepted Answer Pending Moderation
If the plugin is enabled we don't use the SMTP configuration, but the mandrill API.

Do you use:

$mail = JFactory::getMailer();
$mail->send(....);


or how do you exactly send your mails?

Also try to have the plugin ordered first in the plugin list (first for system tasks).

That is what pops up into my head right now.

Regards,
Daniel


Thank you for the prompt reply.


$mail = JFactory::getMailer();
$mail->send(....);


is how the emails are being sent, and the plug-in is ordered first.

Just for the heck of it, I disabled the Mandrill plug-in, and the emails being sent are still using Mandrill (confirmed via headers). The Mail Settings in Joomla are set to send using SMTP, and the Mandrill account info is in there.
  1. more than a month ago
  2. Newbie Area
  3. # 2
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
When do you send the mails? It's not in a CLI script or something like this or?
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. Newbie Area
  3. # 3
Accepted Answer Pending Moderation
Not using CLI script to send emails.
  1. more than a month ago
  2. Newbie Area
  3. # 4
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
The onafterrelease function of the plugin looks like this:

public function onAfterInitialise()
{
$params = JComponentHelper::getParams('com_cmandrill');
$appl = JFactory::getApplication();

$this->loadLanguage('plg_system_mandrill.sys');

$key = $params->get('apiKey');

if (strlen($key)) {

$path = JPATH_ROOT . '/plugins/system/mandrill/mailer/mail.php';

JLoader::register('JMail', $path);
JLoader::load('JMail');

} else {
$appl->enqueueMessage(JText::sprintf('PLG_SYSTEM_MANDRILL_NO_API_KEY_SPECIFIED', JRoute::_('index.php?option=com_cmandrill')), 'warning');
return false;
}
}


So if you have provided an api key in the component, then the plugin will override the JMail class. make a die in the if statement and see if it goes that far?
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. Newbie Area
  3. # 5
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
Also check the joomla logs. If for some reason we were unable to send the mail through the mandril api, we send it using the standard joomla config.

Have a look in the logs folder for a file related to mandrill and check it out.
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. Newbie Area
  3. # 6
Accepted Answer Pending Moderation
Even if the plug-in is disabled?

http://prntscr.com/1cdc6n
  1. more than a month ago
  2. Newbie Area
  3. # 7
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
Well, there you have it man! The plugin should be enabled!
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. Newbie Area
  3. # 8
Accepted Answer Pending Moderation
lol

What I am asking is do you want me to try adding the 'die' test even though I have the plug-in disabled? It is only sending emails through Mandrill if the plug-in is disabled. If I enable the plug-in, it stops sending emails from my component.
  1. more than a month ago
  2. Newbie Area
  3. # 9
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
Ah ok.
If a plugin is turned off, then the plugin doesn't get called by joomla. So if you leave it turn off and you do any die there you won't ever achieve anything.

The plugin needs to be on.
Also when do you send the mails. the plugin is executed onAFterInitialise -> if you send your mails before that, then it won't be able to do anything.
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. Newbie Area
  3. # 10
  • Page :
  • 1


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

Last questions

J5 compatibility for Hotspots
Hi guys, Just started to update my old J3x website. Is there J5 compatibility p...
2 Replies
Posted on Monday, 24 February 2025
  • #Hotspots
  • #hotspots Joomla 5
error message when adding/cofiguring email address
When configuring the email plugin that send a email message to admin when a new ...
0 Replies
Posted on Friday, 09 May 2025
  • New
  • CMigrator: Path from Drupal 6 to J5?
    (Category s/b CMigrator, but didn't see it on the list) I'm interested in usi...
    0 Replies
    Posted on Monday, 28 April 2025
    Dowload all Hotspots entries
    Hi there, I'm looking for a way to dowload all the Hotspots entries. I've got t...
    0 Replies
    Posted on Sunday, 06 April 2025
    • #kml
    • #download
    Set number of hotspots / user groups
    Hi, I'm working with Hotspots for my new website and I love it! After trying ...
    0 Replies
    Posted on Monday, 31 March 2025