Closed kavitachavan123 closed 4 years ago
The module was recently updated to fix some bugs - make sure youre using the very latest version from this repos.
Hi Chris,
Kavita and I are from same team. Email is still not coming. I have tried again today. PFA the module with logger statements and log file if it gives some clue to you.
Thanks, Rohan
If the RC is non 0 then it is sending the emails (from the wizard's point of view), and you need to look outside the portal for where things might be going wrong.
Maybe its as simple as your SMTP config is wrong. Spam folder?
Note the portal does NOT send emails itself - it makes a REST call to apim and apim sends the email for us. So you could check the api manager logs for the incoming call to send the emails. You could also check whether email sending in general works - e.g. fill in the site contact form on the portal site and see if the admin receives the email.
The module as is now works for me on my fp13 system (im not aware of any changes in the portal's email handling code in fp13 so i don't think that will make any difference but you could try upgrading to fp13 if you wanted to).
This is what the portal's email settings should look like - we do not advise changing them as it will likely mean the portal wont be able to send emails anymore.
Hi Chris ,
I am able to send emails to the product subscribers using option Home => Administration => People => Email Subscribers from developer portal. But no emails triggered using custom module.
Also find sreenshot for the email config from my developer portal.
Thanks & Regards Kavita
Chris,
I also could not find any errors in the API Manager logs while testing the module. Can we have a troubleshooting session at your convenient time ?
Thanks, Rohan
Hi Chris.
We are able to get emails if we change the direct flag to FALSE like below:
$message['direct'] = FALSE;
As per the code - https://github.com/ibm-apiconnect/devportal/blob/APIC_v2018/mail_subscribers/src/Service/MailService.php - Line 622:
if ($mailParams['direct'] !== NULL && (boolean) $mailParams['direct'] === TRUE) {
$operations[] = ['mail_subscribers_batch_deliver', [$message]];
}
else {
_mail_subscribers_prepare_mail($message);
// Queue the message to the spool table.
$options = ['target' => 'default'];
Database::getConnection($options['target'])
->insert('mail_subscribers_spool', $options)
->fields($message)
->execute();
}
if the cursor goes to if section , it does not work, if it goes to else , it works. So, basically mail_subscribers_batch_deliver is not working . Can you please take a look at it ?
Thanks, Rohan
We had found the same, we're investigating now.
On Thu, 10 Sep 2020 at 16:48, rohanbcbst notifications@github.com wrote:
Hi Chris.
We are able to get emails if we change the direct flag to FALSE like below:
$message['direct'] = FALSE;
As per the code -
Line 622:
if ($mailParams['direct'] !== NULL && (boolean) $mailParams['direct'] === TRUE) { $operations[] = ['mail_subscribers_batch_deliver', [$message]]; } else { _mail_subscribers_prepare_mail($message); // Queue the message to the spool table. $options = ['target' => 'default']; Database::getConnection($options['target']) ->insert('mail_subscribers_spool', $options) ->fields($message) ->execute(); }
if the cursor goes to if section , it does not work, if it goes to else , it works. Can you please take a look at it ?
Thanks, Rohan
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ibm-apiconnect/devportal-addons/issues/11#issuecomment-690385573, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYLV3FCYFHNE4VP2WS6RLDSFDYOXANCNFSM4QUR5C7Q .
We tracked it down - you have to set direct to false and then everything works as expected. direct=true only works when you are currently logged in, it needs the UI session to run. This module runs unattended by the system when hooks fire so it needs to be non-direct. Code change added to the sample module.
Thanks for the bug report!
Hi ,
I am using 2018.4.1.10 version of APIC . I have installed custom module from Developer portal. When deprecating published product no email is triggered. When printing
$rc = $mailService->mailProductMembers($message, $from, $langcode); \Drupal::logger('RC ')->error('====Printing rc===='); \Drupal::logger('RC')->error($rc);
in console WATCHDOG: [ERROR] [RC] ====Printing rc==== | user: anonymous | uri: http:/// | referer: #015
====Printing rc==== [error]
WATCHDOG: [ERROR] [RC] 1 | user: anonymous | uri: http:/// | referer: #015
1
On changing number of consumers , RC count is also changed , still no email received by subscribers on deprecation
Thanks & Regards Kavita