Body: <p>We have just done a major upgrade from 5.17.3 to 5.77.1 on our community site.  Most things went well.</p>
  <p>I am however having a problem sending out a mailing.  We get the same errors when we schedule the whole mailing, to what I do just selecting &quot;Send Test&quot; and then looking in the log.</p>
  <pre><code>PHP Fatal error:  Uncaught Error: Class 'CIVICRM_FLEXMAILER_HACK_DELIVER' not found in /mnt/sdb/www/&lt;site name&gt;/epc/plugins/civicrm/civicrm/Civi/Core/Resolver.php:100
  Stack trace:
  #0 /mnt/sdb/www/&lt;site name&gt;/epc/plugins/civicrm/civicrm/Civi/Core/Resolver.php(118): Civi\\Core\\Resolver-&gt;get()
  #1 /mnt/sdb/www/&lt;site name&gt;/epc/plugins/civicrm/civicrm/CRM/Mailing/BAO/MailingJob.php(175): Civi\\Core\\Resolver-&gt;call()
  #2 /mnt/sdb/www/&lt;site name&gt;/epc/plugins/civicrm/civicrm/api/v3/Mailing.php(735): CRM_Mailing_BAO_MailingJob::runJobs()
  #3 /mnt/sdb/www/&lt;site name&gt;/epc/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_mailing_send_test()
  #4 /mnt/sdb/www/&lt;site name&gt;/epc/plugins/civicrm/civicrm/Civi/API/Kernel.php(153): Civi\\API\\Provider\\MagicFunctionProvider-&gt;invoke()
  #5 /mnt/sdb/www/&lt;site name&gt;/epc/plugins/civicrm/civicrm/Civi/API/Kernel.php(79): Civi\\API\\Kernel-&gt;runRequest()
  #6 /mnt/sdb/www/&lt;site name&gt;/epc/plugins/civicrm/civicrm/Civi/API/Subscriber/ChainSubscriber.php(205 in /mnt/sdb/www/&lt;site name&gt;/epc/plugins/civicrm/civicrm/Civi/Core/Resolver.php on line 100, referer: https://&lt;site name&gt;/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm%2Fa%2F
  </code></pre>
  <p>civicrm/civicrm/ext/flexmailer is present and pristine (from 5.77.1 sources), and the site shows the extension as loaded in Administer =&gt; System Settings =&gt; Extensions</p>
  <p>Trying some hackery, and adding this to the top of MailingJob.php</p>
  <pre><code>if (!defined('CIVICRM_CRED_KEYS')) {
  define('CIVICRM_FLEXMAILER_HACK_DELIVER', '\Civi\FlexMailer\FlexMailer::createAndRun');
  }
  </code></pre>
  <p>and now I get 30 seconds of spam such as this in the log, and no mail (LockManager kicks in 'PHP Fatal error:  Maximum execution time of 30 seconds exceeded'):</p>
  <pre><code>PHP Warning:  call_user_func_array() expects parameter 1 to be a valid callback, class '\\Civi\\FlexMailer\\FlexMailer' not found in /mnt/sdb/www/&lt;site name&gt;/epc/plugins/civicrm/civicrm/Civi/Core/Resolver.php on line 119, referer: https://&lt;site name&gt;/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm%2Fa%2F
  </code></pre>
  <p>All signs point to the extension not being added to Civi's namepsaces - but I don't know where to go from here.</p>
  <p>(Non-mailing mail is sending fine from the site)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-14T08:39:00.777Z
Comments.Text: Do you also have flexmailer installed as a normal extension?  If so, remove it.
Comments.UserDisplayName: Aidan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-15T22:52:59.470Z
Comments.Text: I don't think so.  The only files matching flexmailer* are in civicrm/civicrm/ext which matches https://github.com/civicrm/civicrm-core/tree/5.77/ext/flexmailer
  
  I had seen that the standalone plugin was retired, but I presume that this plugin from Github is ok?
Comments.UserDisplayName: Andy Yelland
Tags: <wordpress><civimail><flexmailer>
Title: Flexmailer define not found by MailingJob.php
ThreadText: # Flexmailer define not found by MailingJob.php
  
  (Asked by: username_0 on 2024-10-12)
  
  We have just done a major upgrade from 5.17.3 to 5.77.1 on our community site.  Most things went well.
  I am however having a problem sending out a mailing.  We get the same errors when we schedule the whole mailing, to what I do just selecting "Send Test" and then looking in the log.
  PHP Fatal error:  Uncaught Error: Class 'CIVICRM_FLEXMAILER_HACK_DELIVER' not found in /mnt/sdb/www//epc/plugins/civicrm/civicrm/Civi/Core/Resolver.php:100
  Stack trace:
  #0 /mnt/sdb/www//epc/plugins/civicrm/civicrm/Civi/Core/Resolver.php(118): Civi\\Core\\Resolver->get()
  #1 /mnt/sdb/www//epc/plugins/civicrm/civicrm/CRM/Mailing/BAO/MailingJob.php(175): Civi\\Core\\Resolver->call()
  #2 /mnt/sdb/www//epc/plugins/civicrm/civicrm/api/v3/Mailing.php(735): CRM_Mailing_BAO_MailingJob::runJobs()
  #3 /mnt/sdb/www//epc/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_mailing_send_test()
  #4 /mnt/sdb/www//epc/plugins/civicrm/civicrm/Civi/API/Kernel.php(153): Civi\\API\\Provider\\MagicFunctionProvider->invoke()
  #5 /mnt/sdb/www//epc/plugins/civicrm/civicrm/Civi/API/Kernel.php(79): Civi\\API\\Kernel->runRequest()
  #6 /mnt/sdb/www//epc/plugins/civicrm/civicrm/Civi/API/Subscriber/ChainSubscriber.php(205 in /mnt/sdb/www//epc/plugins/civicrm/civicrm/Civi/Core/Resolver.php on line 100, referer: https:///wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fa%2F
  
  civicrm/civicrm/ext/flexmailer is present and pristine (from 5.77.1 sources), and the site shows the extension as loaded in Administer => System Settings => Extensions
  Trying some hackery, and adding this to the top of MailingJob.php
  if (!defined('CIVICRM_CRED_KEYS')) {
  define('CIVICRM_FLEXMAILER_HACK_DELIVER', '\Civi\FlexMailer\FlexMailer::createAndRun');
  }
  
  and now I get 30 seconds of spam such as this in the log, and no mail (LockManager kicks in 'PHP Fatal error:  Maximum execution time of 30 seconds exceeded'):
  PHP Warning:  call_user_func_array() expects parameter 1 to be a valid callback, class '\\Civi\\FlexMailer\\FlexMailer' not found in /mnt/sdb/www//epc/plugins/civicrm/civicrm/Civi/Core/Resolver.php on line 119, referer: https:///wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fa%2F
  
  All signs point to the extension not being added to Civi's namepsaces - but I don't know where to go from here.
  (Non-mailing mail is sending fine from the site)
  
  **Tags:** wordpress, civimail, flexmailer
  
  > **Comments:**
  > **username_1**: Do you also have flexmailer installed as a normal extension?  If so, remove it.  
  > **username_0**: I don't think so.  The only files matching flexmailer* are in civicrm/civicrm/ext which matches https://github.com/civicrm/civicrm-core/tree/5.77/ext/flexmailer  I had seen that the standalone plugin was retired, but I presume that this plugin from Github is ok?  
  
  ---
  
  ## 0 answers
  
  