Announcement

Collapse
No announcement yet.

Abstraction layer for communicating with external systems needed.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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

    Comment


    • #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


      • #4
        Now I understand what you meant.

        Comment

        Working...
        X