-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add BroadcastListRecipientsAsync method #145
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| namespace Resend; | ||
|
|
||
| /// <summary> | ||
| /// Query parameters for <see cref="IResend.BroadcastListRecipientsAsync"/>. | ||
| /// </summary> | ||
| public class BroadcastListRecipientsQuery : PaginatedQuery | ||
| { | ||
| /// <summary> | ||
| /// Filters recipients whose email contains this value. | ||
| /// </summary> | ||
| public string? Email { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Filters bounced recipients by bounce classification. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Only meaningful when the requested event type is <see cref="BroadcastRecipientEventType.Bounced"/>. | ||
| /// </remarks> | ||
| public BroadcastRecipientBounceType? BounceType { get; set; } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace Resend; | ||
|
|
||
| /// <summary> | ||
| /// A broadcast recipient, as returned for a given <see cref="BroadcastRecipientEventType"/>. | ||
| /// </summary> | ||
| /// <see href="https://resend.com/docs/api-reference/broadcasts/list-broadcast-recipients" /> | ||
| public class BroadcastRecipient | ||
| { | ||
| /// <summary> | ||
| /// Opaque cursor identifying this row, used only for pagination. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Does not identify any entity in Resend -- use <see cref="ContactId"/> to reference | ||
| /// the contact. | ||
| /// </remarks> | ||
| [JsonPropertyName( "id" )] | ||
| public string Id { get; set; } = default!; | ||
|
|
||
| /// <summary> | ||
| /// Identifier of the contact matching this recipient. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Null when the recipient's email no longer maps to a contact. | ||
| /// </remarks> | ||
| [JsonPropertyName( "contact_id" )] | ||
| public Guid? ContactId { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// The recipient's email address. | ||
| /// </summary> | ||
| [JsonPropertyName( "email" )] | ||
| public string Email { get; set; } = default!; | ||
|
|
||
| /// <summary> | ||
| /// Number of times this recipient triggered the event. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Only present when the requested <see cref="BroadcastRecipientEventType"/> is | ||
| /// <see cref="BroadcastRecipientEventType.Opened"/> or <see cref="BroadcastRecipientEventType.Clicked"/>. | ||
| /// </remarks> | ||
| [JsonPropertyName( "count" )] | ||
| [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] | ||
| public int? Count { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// The bounce classification. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Only present when the requested <see cref="BroadcastRecipientEventType"/> is | ||
| /// <see cref="BroadcastRecipientEventType.Bounced"/>. | ||
| /// </remarks> | ||
| [JsonPropertyName( "bounce_type" )] | ||
| [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] | ||
| public BroadcastRecipientBounceType? BounceType { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// The links this recipient clicked. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Only present when the requested <see cref="BroadcastRecipientEventType"/> is | ||
| /// <see cref="BroadcastRecipientEventType.Clicked"/>. | ||
| /// </remarks> | ||
| [JsonPropertyName( "clicked_links" )] | ||
| [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] | ||
| public List<BroadcastRecipientClickedLink>? ClickedLinks { get; set; } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace Resend; | ||
|
|
||
| /// <summary> | ||
| /// Broadcast recipient bounce classifications. | ||
| /// </summary> | ||
| [JsonConverter( typeof( JsonStringEnumValueConverter<BroadcastRecipientBounceType> ) )] | ||
| public enum BroadcastRecipientBounceType | ||
| { | ||
| /// <summary> | ||
| /// The bounce is permanent; the address is not expected to become deliverable. | ||
| /// </summary> | ||
| [JsonStringValue( "permanent" )] | ||
| Permanent, | ||
|
|
||
| /// <summary> | ||
| /// The bounce is transient; the address may become deliverable again. | ||
| /// </summary> | ||
| [JsonStringValue( "transient" )] | ||
| Transient, | ||
|
|
||
| /// <summary> | ||
| /// The bounce could not be classified. | ||
| /// </summary> | ||
| [JsonStringValue( "undetermined" )] | ||
| Undetermined, | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace Resend; | ||
|
|
||
| /// <summary> | ||
| /// A link clicked by a broadcast recipient. | ||
| /// </summary> | ||
| public class BroadcastRecipientClickedLink | ||
| { | ||
| /// <summary> | ||
| /// The clicked URL. | ||
| /// </summary> | ||
| [JsonPropertyName( "url" )] | ||
| public string Url { get; set; } = default!; | ||
|
|
||
| /// <summary> | ||
| /// Number of times this recipient clicked this URL. | ||
| /// </summary> | ||
| [JsonPropertyName( "clicks" )] | ||
| public int Clicks { get; set; } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace Resend; | ||
|
|
||
| /// <summary> | ||
| /// Broadcast recipient event types. | ||
| /// </summary> | ||
| [JsonConverter( typeof( JsonStringEnumValueConverter<BroadcastRecipientEventType> ) )] | ||
| public enum BroadcastRecipientEventType | ||
| { | ||
| /// <summary> | ||
| /// Recipient the broadcast was sent to. | ||
| /// </summary> | ||
| [JsonStringValue( "sent" )] | ||
| Sent, | ||
|
|
||
| /// <summary> | ||
| /// Recipient whose email was delivered. | ||
| /// </summary> | ||
| [JsonStringValue( "delivered" )] | ||
| Delivered, | ||
|
|
||
| /// <summary> | ||
| /// Recipient who opened the email. | ||
| /// </summary> | ||
| [JsonStringValue( "opened" )] | ||
| Opened, | ||
|
|
||
| /// <summary> | ||
| /// Recipient who clicked a link in the email. | ||
| /// </summary> | ||
| [JsonStringValue( "clicked" )] | ||
| Clicked, | ||
|
|
||
| /// <summary> | ||
| /// Recipient whose email bounced. | ||
| /// </summary> | ||
| [JsonStringValue( "bounced" )] | ||
| Bounced, | ||
|
|
||
| /// <summary> | ||
| /// Recipient who marked the email as spam. | ||
| /// </summary> | ||
| [JsonStringValue( "complained" )] | ||
| Complained, | ||
|
|
||
| /// <summary> | ||
| /// Recipient who unsubscribed. | ||
| /// </summary> | ||
| [JsonStringValue( "unsubscribed" )] | ||
| Unsubscribed, | ||
|
|
||
| /// <summary> | ||
| /// Recipient who was suppressed and did not receive the email. | ||
| /// </summary> | ||
| [JsonStringValue( "suppressed" )] | ||
| Suppressed, | ||
| } |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.