discourse/app/controllers
Alan Guo Xiang Tan 209d289772
FIX: No method error in WebhooksController#sendgrid (#31495)
When an email is sent by sendgrid to an email address with an invalid
host, the webhook payload does not contain the "status" field:

```
[
  {
    "bounce_classification": "Unclassified",
    "email": "noemail@this.does.not.exist.tld",
    "event": "bounce",
    "reason": "unable to get mx info: failed to get IPs from PTR record: lookup <nil>: unrecognized address",
    "sg_event_id": "Ym91bmNlLTQtNTA0ODUxOTUtZXVvMmlLeGRTYXlQRjRZRTQtLUk3QS0w",
    "sg_message_id": "euo2iKxdSayPF4YE4--I7A.recvd-5f54b5d587-pczjm-1-67BADEEA-6.0",
    "smtp-id": "<870b3a2a-160c-4fc8-bc9a-bd0d5b943b81@forum.umbraco.com>",
    "timestamp": 1740300320,
    "tls": 0,
    "type": "blocked"
  }
]
```

When the `status` field is missing, it results in a `NoMethodError
(undefined method `[]' for nil:NilClass)`
error in the controller method. In this commit, we will specifically
handle the webhook event from sendgrid when the email address's domain
is invalid.

Co-Authored-By: @nul800sebastiaan
2025-02-25 13:08:59 +08:00
..
admin FIX: include silence_reason when admin sees user (#31493) 2025-02-25 14:14:33 +11:00
users
about_controller.rb
application_controller.rb SECURITY: Preload data only when rendering application layout 2025-02-04 13:32:30 -03:00
associated_groups_controller.rb
badges_controller.rb
bookmarks_controller.rb
bootstrap_controller.rb DEV: Drop ember-cli-based SCSS and locale compilation (#31407) 2025-02-21 11:15:04 +00:00
categories_controller.rb
clicks_controller.rb
composer_controller.rb
composer_messages_controller.rb
csp_reports_controller.rb
custom_homepage_controller.rb
directory_columns_controller.rb
directory_items_controller.rb FIX: Allow user directory searches to return more than 20 matching results (#31032) 2025-01-29 11:02:42 -04:00
do_not_disturb_controller.rb
drafts_controller.rb
edit_directory_columns_controller.rb
email_controller.rb
embed_controller.rb
emojis_controller.rb
exceptions_controller.rb
export_csv_controller.rb FIX: Only apply the rate limit to user exports, not downloads (#30965) 2025-01-24 09:37:05 +11:00
extra_locales_controller.rb DEV: Clear extra-locales cache between tests (#31488) 2025-02-24 22:10:43 +00:00
finish_installation_controller.rb SECURITY: Preload data only when rendering application layout 2025-02-04 13:32:30 -03:00
form_templates_controller.rb
forums_controller.rb
groups_controller.rb
hashtags_controller.rb
highlight_js_controller.rb
inline_onebox_controller.rb SECURITY: Limit /inline-onebox to 10 URLs at a time 2025-02-04 13:32:53 -03:00
invites_controller.rb FIX: automatically redirect logged in users to topic when... (#31301) 2025-02-12 17:48:59 +01:00
list_controller.rb Don't allow loading tagged PMs in another user's inbox. 2025-02-04 13:32:46 -03:00
metadata_controller.rb
new_invite_controller.rb
new_topic_controller.rb
notifications_controller.rb FEATURE: add new hidden site setting to show full names in user card 2025-01-23 12:26:59 -05:00
offline_controller.rb
onebox_controller.rb
pageview_controller.rb
permalinks_controller.rb
post_action_users_controller.rb
post_actions_controller.rb
post_readers_controller.rb
posts_controller.rb DEV: remove another deprecation notice when serializing args (#31240) 2025-02-09 15:10:41 +01:00
presence_controller.rb
published_pages_controller.rb
push_notification_controller.rb
qunit_controller.rb
reviewable_claimed_topics_controller.rb
reviewables_controller.rb DEV: Add a new type_source field to the Reviewable model. (#31325) 2025-02-20 09:09:47 +11:00
robots_txt_controller.rb FIX: Remove /u/ from robots (#30782) 2025-01-15 13:42:08 +08:00
safe_mode_controller.rb
search_controller.rb DEV: Add proper error response when searching with an invalid page param (#31026) 2025-01-28 15:12:52 -05:00
session_controller.rb
sidebar_sections_controller.rb
similar_topics_controller.rb
site_controller.rb SECURITY: Preload data only when rendering application layout 2025-02-04 13:32:30 -03:00
sitemap_controller.rb
slugs_controller.rb
static_controller.rb
steps_controller.rb
stylesheets_controller.rb FEATURE: Dark/light mode selector (#31086) 2025-02-07 03:28:34 +03:00
svg_sprite_controller.rb
tag_groups_controller.rb
tags_controller.rb
test_requests_controller.rb
theme_javascripts_controller.rb
topic_view_stats_controller.rb
topics_controller.rb FIX: Hijack controller for topic move posts (#31029) 2025-01-28 16:27:30 +10:00
uploads_controller.rb FIX: Incorrect topic per-minute invitation rate limit (#31252) 2025-02-10 13:12:16 +10:00
user_actions_controller.rb
user_api_key_clients_controller.rb
user_api_keys_controller.rb
user_avatars_controller.rb
user_badges_controller.rb PERF: Enqueue Job::BackfillBadge in Jobs::BadgeGrant (#30945) 2025-01-24 09:35:01 +08:00
user_status_controller.rb
users_controller.rb SECURITY: Disable access to "activate-account" route for existing users 2025-02-04 13:32:38 -03:00
users_email_controller.rb
webhooks_controller.rb FIX: No method error in WebhooksController#sendgrid (#31495) 2025-02-25 13:08:59 +08:00
wizard_controller.rb