feat(bindings/twilio/sendgrid): add trackingSettings support - #4456
Open
chadncampbell wants to merge 2 commits into
Open
feat(bindings/twilio/sendgrid): add trackingSettings support#4456chadncampbell wants to merge 2 commits into
chadncampbell wants to merge 2 commits into
Conversation
Allow configuring SendGrid tracking_settings (click_tracking, open_tracking, subscription_tracking, ganalytics) via component metadata or per-request metadata; request-level overrides component. Signed-off-by: Chad Campbell <ccampbell@rechargeapps.com>
chadncampbell
force-pushed
the
feat/sendgrid-tracking-settings
branch
from
July 14, 2026 16:24
ce4f781 to
77ef189
Compare
7 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for SendGrid tracking_settings in the Twilio SendGrid output binding, allowing tracking configuration to be set at the component level and overridden per request.
Changes:
- Added
trackingSettingsmetadata field with init-time parsing and caching. - Applied resolved tracking settings to outgoing SendGrid V3 email requests during
Invoke. - Added unit tests for parsing/unmarshalling tracking settings and updated component metadata documentation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| bindings/twilio/sendgrid/sendgrid.go | Adds trackingSettings metadata, caches parsed settings, and applies tracking settings to outbound emails. |
| bindings/twilio/sendgrid/sendgrid_test.go | Adds tests for parsing and unmarshalling trackingSettings. |
| bindings/twilio/sendgrid/metadata.yaml | Documents the new trackingSettings metadata field with description and example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+226
to
+236
| // Build email tracking settings, this is optional | ||
| var trackingSettings *mail.TrackingSettings | ||
| if req.Metadata["trackingSettings"] != "" { | ||
| var trackingError error | ||
| trackingSettings, trackingError = UnmarshalTrackingSettings(req.Metadata["trackingSettings"]) | ||
| if trackingError != nil { | ||
| return nil, trackingError | ||
| } | ||
| } else if sg.metadata.trackingSettingsCache != nil { | ||
| trackingSettings = sg.metadata.trackingSettingsCache | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Chad Campbell <ccampbell@rechargeapps.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds support for SendGrid
tracking_settingsto the Twilio SendGrid output binding.trackingSettingsmetadata field (component-level), accepting a JSON object using SendGrid API field names:click_tracking,open_tracking,subscription_tracking,ganalyticsInvoke; request-level settings override component-levelInitfor component metadata, atInvokefor request metadatametadata.yamlwith field description and exampleTesting
In addition to the unit tests, manually verified the binding end-to-end against the live SendGrid API using a small script that invokes the binding directly:
trackingSettingsset: no tracking settings are included in the API request, so the SendGrid account-level tracking configuration applies (existing behavior unchanged)trackingSettingsset: email sends with the configured tracking settings applied (confirmed by inspecting the raw email data)Issue reference
#4455
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: