Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for contact tokens for url in Send a webhook campaign action #6494

Merged
merged 3 commits into from Aug 14, 2020

Conversation

kuzmany
Copy link
Member

@kuzmany kuzmany commented Aug 27, 2018

Please be sure you are submitting this against the staging branch.

Q A
Bug fix?
New feature?
Automated tests included?
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs)
BC breaks?
Deprecations?

Description:

This PR added to Send a webhook campaign action (#4357) support for contact token in url.

PR use case based on slack conversation
https://mautic.slack.com/archives/C02HU8BUT/p1533624667000200

Steps to test this PR:

  1. Well. Try setup Send a webhook campaign action.
  2. Add contact token to url (see example)

image

  1. Check If url was replace with token data (need dev skills)

@kuzmany kuzmany added bug Issues or PR's relating to bugs ready-to-test PR's that are ready to test labels Aug 27, 2018
@kuzmany kuzmany added this to the 2.15.0 milestone Aug 27, 2018
@kuzmany kuzmany added enhancement Any improvement to an existing feature or functionality and removed bug Issues or PR's relating to bugs labels Aug 27, 2018
@kuzmany kuzmany changed the title Added support for contact tokens in Send a webhook campaign action Added support for contact tokens for url in Send a webhook campaign action Aug 28, 2018
@npracht npracht added this to To do in Testing 2.15.0 Oct 16, 2018
@albanleandri
Copy link

albanleandri commented Nov 10, 2018

Hi @kuzmany,

I tested this PR according to different use cases I could think and one of them didn't work. I tested only for the POST method, btw.

For my tests, I have found useful to use the https://webhook.site in order to check if the webhooks were sent or not.

The test URL was : https://webhook.site/e02dc6fe-db1b-4872-ba7b-f4ef09ef5f33
For convenience, I used the hash e02dc6fe-db1b-4872-ba7b-f4ef09ef5f33 as the value for my token.

  1. Test Case 1 (Worked) : Create a contact field, set manually e02dc6fe-db1b-4872-ba7b-f4ef09ef5f33 as the field value from a contact profile.

image

image

  1. Test Case 2 (Worked) : Create a contact field and use e02dc6fe-db1b-4872-ba7b-f4ef09ef5f33 as the fallback value in to token inserted in webhook url such as https://webhook.site/{contactfield=webhook_hash_1|e02dc6fe-db1b-4872-ba7b-f4ef09ef5f33}

image

It worked. But I had to adjust the webhook timeout to a higher value or I wouldn't receive all of them (I eventually set 60 seconds.

image

  1. Test Case 3 (Didn't work) : Create a contact field and use e02dc6fe-db1b-4872-ba7b-f4ef09ef5f33 as the default value

image
I can see that the value is set properly in contacts as soon as the contact field is created
image

But the webhook is never sent when the campaign is launched, and there is an error in the contact view
image

@Woeler Woeler added the pending-feedback PR's and issues that are awaiting feedback from the author label Nov 10, 2018
@kuzmany
Copy link
Member Author

kuzmany commented Nov 10, 2018

@can you retest point 3 again? Doesn't make sense. Thanks

@albanleandri
Copy link

@kuzmany OK, I tried again. It worked well for all test cases this time. Thanks

@kuzmany kuzmany added pending-test-confirmation PR's that require one test before they can be merged and removed pending-feedback PR's and issues that are awaiting feedback from the author ready-to-test PR's that are ready to test labels Nov 11, 2018
@kuzmany kuzmany moved this from To do to Tested once in Testing 2.15.0 Nov 11, 2018
@albanleandri
Copy link

Anyone else to test this? It's a great enhancement for "send a webhook" feature. I described an easy way to test it aswell.

@Woeler Woeler modified the milestones: 2.15.0, 2.16.0 Dec 5, 2018
@Woeler Woeler removed this from Tested once in Testing 2.15.0 Dec 5, 2018
@heathdutton heathdutton added this to Code Review (2 required) in Mautic 2 Dec 6, 2018
@heathdutton heathdutton removed this from Code Review (2 required) in Mautic 2 Dec 6, 2018
@npracht npracht added this to Ready to Test (confirmation) in Mautic 2 Aug 15, 2019
@npracht npracht modified the milestone: 2.16.0 Jan 23, 2020
@npracht npracht added Triage M2/M3 and removed pending-test-confirmation PR's that require one test before they can be merged labels Apr 6, 2020
@npracht
Copy link
Member

npracht commented Apr 6, 2020

Hi there!
It has been decided to not create any extra Mautic 2 minor versions (which means no more features in M2) knowing that Mautic 3 is coming very soon.

We now want to integrate your contribution in the Mautic 3 roadmap as 3.1.0 candidate.

How to do?

  1. Check if your feature or enhancement is still missing and relevant in Mautic 3
  2. If Yes: rebase your PR against the 3.x branch
  3. If No: please consider closing your PR if you are absolutely sure that the feature has made it into Mautic 3 already

Please report results by commenting on your PR to make us administration easier.


You can more information on how to do all of that on this blog post "Getting you PR ready for Mautic 3".

@kuzmany kuzmany changed the base branch from staging to 3.x April 24, 2020 19:21
@kuzmany kuzmany force-pushed the webhook-support-tokens-in-url branch from 72ce9af to 5409c19 Compare April 24, 2020 19:29
@kuzmany
Copy link
Member Author

kuzmany commented Apr 24, 2020

Rebased

@kuzmany kuzmany added ready-to-test PR's that are ready to test and removed Triage M2/M3 labels Apr 24, 2020
@npracht npracht added this to the 3.1.0 milestone Apr 24, 2020
@RCheesley RCheesley changed the base branch from 3.x to staging June 17, 2020 11:26
@mabumusa1
Copy link
Member

@kuzmany how can I help with this?

@kuzmany
Copy link
Member Author

kuzmany commented Jul 13, 2020

@mautibot test and review it

mabumusa1
mabumusa1 previously approved these changes Jul 14, 2020
Copy link
Member

@mabumusa1 mabumusa1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I applied and test this PR twice, it works fine

@mabumusa1
Copy link
Member

@dennisameling this PR is working as well, when you have time please review

@RCheesley RCheesley added the contacts Anything related to contacts label Jul 23, 2020
AdMigo
AdMigo previously approved these changes Aug 11, 2020
Copy link

@AdMigo AdMigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this patch, it works well on 3 Mautic 3.0.1 instances. The only issue is it conflicts with pull request #8959

@RCheesley RCheesley dismissed stale reviews from AdMigo and mabumusa1 via 2ea0ac2 August 14, 2020 19:23
@RCheesley RCheesley force-pushed the webhook-support-tokens-in-url branch from f8afad4 to 2ea0ac2 Compare August 14, 2020 19:23
@RCheesley
Copy link
Sponsor Member

Looks like we have two good tests on this PR - I've just rebased to get the code coverage report to confirm that it's good to merge. @mabumusa1 can you take a look at the comments relating to your PR #8959 please?

@codecov
Copy link

codecov bot commented Aug 14, 2020

Codecov Report

Merging #6494 into staging will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             staging    #6494   +/-   ##
==========================================
  Coverage      29.57%   29.58%           
  Complexity     33245    33245           
==========================================
  Files           1937     1937           
  Lines         115172   115170    -2     
==========================================
+ Hits           34067    34068    +1     
+ Misses         81105    81102    -3     
Impacted Files Coverage Δ Complexity Δ
...kBundle/Form/Type/CampaignEventSendWebhookType.php 0.00% <ø> (ø) 4.00 <0.00> (ø)
...pp/bundles/WebhookBundle/Helper/CampaignHelper.php 87.23% <100.00%> (+0.27%) 20.00 <0.00> (ø)

Copy link
Sponsor Member

@RCheesley RCheesley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving based on the previous two 👍 votes which were dismissed with the rebase

@RCheesley RCheesley merged commit 3cef551 into mautic:staging Aug 14, 2020
@mabumusa1
Copy link
Member

Looks like we have two good tests on this PR - I've just rebased to get the code coverage report to confirm that it's good to merge. @mabumusa1 can you take a look at the comments relating to your PR #8959 please?

@RCheesley I rebased to staging the comments should be handled after the test finishes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contacts Anything related to contacts enhancement Any improvement to an existing feature or functionality ready-to-test PR's that are ready to test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants