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

Changes to Submission Form?
Are you able to make changes to the Hotspot submission form? There are several f...
0 Replies
Posted on Friday, 26 April 2024
  • New
  • Question regarding custom fields
    How do I access custom fields after I have created them?...
    0 Replies
    Posted on Wednesday, 24 April 2024
  • New
    • #custom fields
    Google no index für bestimmte Seiten/Details
    Hallo ich habe eine kleine Frage: wo kann ich einstellen, dass Google die Seite...
    0 Replies
    Posted on Wednesday, 24 April 2024
  • New
  • Language parameter in the link to the comment
    Hello. 1) I have a multilingual website (3 languages). If someone added a comme...
    1 Replies
    Posted on Saturday, 06 April 2024
    categories icon in header
    Hi! I saw this in the promo, but I can't find how to set it up. https://compo...
    0 Replies
    Posted on Monday, 22 April 2024
  • New
    • #style
    • #Categories