parent
87ee87f915
commit
cb8afcd852
|
@ -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(),
|
||||||
|
]),
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue