Update tweet text

References #332
This commit is contained in:
Oliver Davies 2021-01-01 23:16:56 +00:00
parent 87ee87f915
commit cb8afcd852

View file

@ -5,12 +5,15 @@ declare(strict_types=1);
namespace Drupal\opdavies_blog\Service\PostPusher; namespace Drupal\opdavies_blog\Service\PostPusher;
use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\opdavies_blog\Entity\Node\Post; use Drupal\opdavies_blog\Entity\Node\Post;
use GuzzleHttp\ClientInterface; use GuzzleHttp\ClientInterface;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
final class IftttPostPusher extends HttpPostPusher { final class IftttPostPusher extends HttpPostPusher {
use StringTranslationTrait;
private ConfigFactoryInterface $configFactory; private ConfigFactoryInterface $configFactory;
public function __construct( public function __construct(
@ -31,7 +34,9 @@ final class IftttPostPusher extends HttpPostPusher {
$this->client->post($url, [ $this->client->post($url, [
'form_params' => [ 'form_params' => [
'value1' => $post->toTweet(), 'value1' => $this->t('Blogged: @text', [
'@text' => $post->toTweet(),
]),
], ],
]); ]);
} }