Skip to content

Commit 191f388

Browse files
committed
feature #48084 [Notifier] Add Twitter notifier (nicolas-grekas)
This PR was merged into the 6.3 branch. Discussion ---------- [Notifier] Add Twitter notifier | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Let's make it easy to tweet from Symfony apps. ```php $tweet = new ChatMessage('Hello World', (new TwitterOptions()) ->attachImage(new File('/path/to/image.jpg'), 'Alt text for the image') ); $chatter->send($tweet->transport('twitter')); ``` The `TwitterOptions` class supports all options from [`/2/tweets`](https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets) and also supports adding alt text to images and subtitles to videos, all this using async uploads. `TwitterTransport::request()` is also exposed as public API to make authenticated requests to any other API endpoints. Commits ------- a9d621cca9 [Notifier] Add Twitter notifier
2 parents 93fc3e5 + 023d12d commit 191f388

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173
use Symfony\Component\Notifier\Bridge\Telnyx\TelnyxTransportFactory;
174174
use Symfony\Component\Notifier\Bridge\TurboSms\TurboSmsTransport;
175175
use Symfony\Component\Notifier\Bridge\Twilio\TwilioTransportFactory;
176+
use Symfony\Component\Notifier\Bridge\Twitter\TwitterTransportFactory;
176177
use Symfony\Component\Notifier\Bridge\Vonage\VonageTransportFactory;
177178
use Symfony\Component\Notifier\Bridge\Yunpian\YunpianTransportFactory;
178179
use Symfony\Component\Notifier\Bridge\Zendesk\ZendeskTransportFactory;
@@ -2594,6 +2595,7 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
25942595
TelnyxTransportFactory::class => 'notifier.transport_factory.telnyx',
25952596
TurboSmsTransport::class => 'notifier.transport_factory.turbo-sms',
25962597
TwilioTransportFactory::class => 'notifier.transport_factory.twilio',
2598+
TwitterTransportFactory::class => 'notifier.transport_factory.twitter',
25972599
VonageTransportFactory::class => 'notifier.transport_factory.vonage',
25982600
YunpianTransportFactory::class => 'notifier.transport_factory.yunpian',
25992601
ZendeskTransportFactory::class => 'notifier.transport_factory.zendesk',

Resources/config/notifier_transports.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
use Symfony\Component\Notifier\Bridge\Telnyx\TelnyxTransportFactory;
6060
use Symfony\Component\Notifier\Bridge\TurboSms\TurboSmsTransportFactory;
6161
use Symfony\Component\Notifier\Bridge\Twilio\TwilioTransportFactory;
62+
use Symfony\Component\Notifier\Bridge\Twitter\TwitterTransportFactory;
6263
use Symfony\Component\Notifier\Bridge\Vonage\VonageTransportFactory;
6364
use Symfony\Component\Notifier\Bridge\Yunpian\YunpianTransportFactory;
6465
use Symfony\Component\Notifier\Bridge\Zendesk\ZendeskTransportFactory;
@@ -105,6 +106,10 @@
105106
->parent('notifier.transport_factory.abstract')
106107
->tag('texter.transport_factory')
107108

109+
->set('notifier.transport_factory.twitter', TwitterTransportFactory::class)
110+
->parent('notifier.transport_factory.abstract')
111+
->tag('chatter.transport_factory')
112+
108113
->set('notifier.transport_factory.all-my-sms', AllMySmsTransportFactory::class)
109114
->parent('notifier.transport_factory.abstract')
110115
->tag('texter.transport_factory')

0 commit comments

Comments
 (0)