Many Thanks Yuri,
you are ours professor too...
Best Regards
How to add sms providers for two factor authenication
Collapse
X
-
To find out how to declare implementations in metadata check factory classes.
https://github.com/espocrm/espocrm/b...actory.php#L66
Your metadata is not right.
PHP Code:{ "Spryng": { "senderClassName": "Espo\\Custom\\Core\\Provider\\SpryngSms" } }Last edited by yuri; 10-04-2021, 04:44 PM. -
Hello,
are you developper ?
i try to do same... but i can't test it actually :
create file :
custom/Ressources/metadata/app/smsProviders.json
create file :PHP Code:{ "Spryng": "\\Espo\\Custom\\Core\\Provider\\SpryngSms" }
custom/Core/Provider/SpryngSms.php
Clear CachePHP Code:<?php namespace Espo\Custom\Core\Provider; use Spryng\SpryngRestApi\{ Spryng, Objects\Message, }; use Espo\Core\ORM\EntityManager; use Espo\Core\Sms\Sms; class SpryngSms implements \Espo\Core\Sms\Sender { protected $entityManager; public function __construct( EntityManager $entityManager ) { $this->entityManager = $entityManager; } public function send(Sms $sms) : void { $integration = $this->entityManager->getEntity('Integration', 'SpryngSms'); $spryng = new Spryng( $integration->get('apiKey') ); $messageSpryng = new Message(); $messageSpryng->setOriginator($integration->get('originator') ); $messageSpryng->setRoute('business'); $messageSpryng->setEncoding('auto'); $messageSpryng->setRecipients( $sms->getToNumberList() ); $messageSpryng->setBody($sms->getBody()); $response = $spryng->message->send($messageSpryng); } }
now you can select Spryng
Of course, you need to adapt to your Provider..
I don't know if that's work..
Maybe Yuri can say if i am on the right way
So if somes developper do this kind of extension, the community will be happy.
Leave a comment:
-
In release notes it's stated that there's no SMS providers shipped at this moment. Developers can add implementations for specific providers.Leave a comment:
-
I have my own local sms provider . i have to send http request to api with some unique id for authroization. currently i am using that sms service through advance pack now i want to use the same sms provider for two factor authenication
please help me to setup my sms provider for using two factor authenication -
(1) Who is your SMS provider?
(2) You can buy the extension (official and unofficial) that may support your provide.
(3) I think the Advanced Pack can do CRUD/HTTPS request so it should be able to emulated the requirement your SMS have.Leave a comment:
-
How to add sms providers for two factor authenication
Hello Team,
I want to add my sms providers in espo crm for two factor authenication how to add
my sms providers supports http requestTags: None

Leave a comment: