Skip to content

Tweak docs for Webhooks #19421

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

Merged
merged 1 commit into from
Jan 24, 2024
Merged

Tweak docs for Webhooks #19421

merged 1 commit into from
Jan 24, 2024

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Jan 16, 2024

Thank you so much @TimoBakx for having bootstrapped the webhook docs.
This PR hopefully contains some improvements.

I will be able to merge this PR up as it will probably generate some conflicts

@carsonbot carsonbot added this to the 6.3 milestone Jan 16, 2024
@@ -19,17 +19,26 @@ Installation
Usage in Combination with the Mailer Component
----------------------------------------------

When using a third-party mailer, you can use the Webhook component to receive
webhook calls from the third-party mailer.
When using a third-party mailer provider, you can use the Webhook component to
Copy link
Member Author

Choose a reason for hiding this comment

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

We are using "provider" in the notifier and mailer docs, let's use the same here.

file:
For Mailgun, you will get a secret for the webhook. Store this secret as
MAILER_MAILGUN_SECRET (in the :doc:`secrets management system
</configuration/secrets>` or in a ``.env`` file).
Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should encourage people to use Symfony secrets instead of .env. If you agree, I can work on a PR to make similar changes in other places.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense to me

Copy link
Contributor

Choose a reason for hiding this comment

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

My feeling is that env variables are far more used than secrets so I think it does not hurt to mention both, just my 2 cents


With this done, you can now add a RemoteEvent consumer to react to the webhooks::
For mailer webhooks, react to the
:class:`Symfony\\Component\\RemoteEvent\\Event\\Mailer\\MailerDeliveryEvent` or
Copy link
Member Author

Choose a reason for hiding this comment

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

Having links to the events allows for a better discovery of all possible events.

@@ -145,12 +154,8 @@ SMS service Parser service name
Twilio ``notifier.webhook.request_parser.twilio``
============ ==========================================

.. versionadded:: 6.3

The support for Twilio was introduced in Symfony 6.3.
Copy link
Member Author

Choose a reason for hiding this comment

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

The component was added in 6.3, so we don't need that.

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

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

Nice changes. Thanks Fabien.

@fabpot fabpot force-pushed the webhook-doc-tweaks branch from c940708 to 534babd Compare January 16, 2024 07:41
@symfony symfony deleted a comment from carsonbot Jan 16, 2024
Copy link
Member

@TimoBakx TimoBakx left a comment

Choose a reason for hiding this comment

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

Nice! These are good improvements.

In this example Mailgun is used with ``'mailer_mailgun'`` as the webhook type.
Any type name can be used as long as it is unique. Make sure to use it in the
routing configuration, the webhook URL and the RemoteEvent consumer.
Currently, the following third-party mailer providers support webhooks:
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently, the following third-party SMS transports support webhooks:

L149

Should we also add 'provider' in sentence ?

@OskarStark
Copy link
Contributor

Thanks Fabien. For the reviewers, feel free to provide smaller pull requests, thanks.

@OskarStark OskarStark merged commit 71b45d2 into symfony:6.3 Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants