Skip to content

Commit

Permalink
Merge pull request #6494 from kuzmany/webhook-support-tokens-in-url
Browse files Browse the repository at this point in the history
Added support for contact tokens for url in Send a webhook campaign action
  • Loading branch information
RCheesley committed Aug 14, 2020
2 parents bf7ea02 + 2ea0ac2 commit 3cef551
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Url;

/**
* Class CampaignEventRemoteUrlType.
Expand Down Expand Up @@ -50,11 +49,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'attr' => ['class' => 'form-control'],
'required' => true,
'constraints' => [
new Url(
[
'message' => 'mautic.form.submission.url.invalid',
]
),
new NotBlank(
[
'message' => 'mautic.core.value.required',
Expand Down
3 changes: 2 additions & 1 deletion app/bundles/WebhookBundle/Helper/CampaignHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public function fireWebhook(array $config, Lead $contact)
// dump($config);die;
$payload = $this->getPayload($config, $contact);
$headers = $this->getHeaders($config, $contact);
$this->makeRequest($config['url'], $config['method'], $config['timeout'], $headers, $payload);
$url = rawurldecode(TokenHelper::findLeadTokens($config['url'], $this->getContactValues($contact), true));
$this->makeRequest($url, $config['method'], $config['timeout'], $headers, $payload);
}

/**
Expand Down

0 comments on commit 3cef551

Please sign in to comment.