Abstraction layer for communicating with external systems needed.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paladin80
    Junior Member
    • Aug 2014
    • 11

    Abstraction layer for communicating with external systems needed.

    Different hostings have various restrictions for mailing. Someone limit number of mails can be sent per hour, others disable SMTP mailing and encourage to use php mail().
    Every time you interact with external module or system, you need to be able to fine tune intermediate code for the best compatibility.

    I ask to add an abstraction layer for services that work with external systems: create API Interfaces and put their implementation class names in the config.php.
    With this, developer can implement his own service classes’ without need to hack into the CRM source.
    Last edited by paladin80; 08-19-2014, 07:51 AM. Reason: spell ckeck
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    We are going to add a framework for External APIs. Can you describe your vision more deeply. How this should be configured in config?

    Thanks
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • paladin80
      Junior Member
      • Aug 2014
      • 11

      #3
      Code:
      //sender.php
      namespace Espo\Core\Mail;
      //MailSenderAPI describes public methods used to send mail
      class Sender implements MailSenderAPI
      {
          //...
      }
      
      ​
      //Container.php
      namespace Espo\Core;
      class Container
      {
          //...
          
          private function loadMailSender()
          {
              $senderClass = $this->get('config')->get('mailSenderClassName');
              if (empty($senderClass)) {
                  $senderClass = '\Espo\Core\Mail\Sender';
              }
              return new $senderClass($this->get('config'));
          }
      
          //...
      }
      And provide some way to include user classes into autoloader.

      Comment

      • yuri
        Member
        • Mar 2014
        • 8440

        #4
        Now I understand what you meant.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        Working...