Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Resend.Webhooks/ContactEventData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public class ContactEventData : IWebhookData
[JsonPropertyName( "id" )]
public Guid ContactId { get; set; }

/// <summary />
[JsonPropertyName( "audience_id" )]
[JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )]
public string? AudienceId { get; set; }

/// <summary />
[JsonPropertyName( "segment_ids" )]
[JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )]
Expand Down
51 changes: 51 additions & 0 deletions src/Resend.Webhooks/EmailEventData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ public class EmailEventData : IWebhookData
[JsonPropertyName( "subject" )]
public string Subject { get; set; } = default!;

/// <summary />
[JsonPropertyName( "broadcast_id" )]
public string? BroadcastId { get; set; }
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.

/// <summary />
[JsonPropertyName( "template_id" )]
public string? TemplateId { get; set; }

/// <summary />
[JsonPropertyName( "tags" )]
public Dictionary<string, string>? Tags { get; set; }

/// <summary />
/// <remarks>
/// Only set for <see cref="WebhookEventType.EmailClicked" />, otherwise is null.
Expand All @@ -41,6 +53,22 @@ public class EmailEventData : IWebhookData
[JsonPropertyName( "bounce" )]
[JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )]
public EmailBounceData? Bounce { get; set; }

/// <summary />
/// <remarks>
/// Only set for <see cref="WebhookEventType.EmailFailed"/>
/// </remarks>
[JsonPropertyName( "failed" )]
[JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )]
public EmailFailedData? Failed { get; set; }

/// <summary />
/// <remarks>
/// Only set for <see cref="WebhookEventType.EmailSuppressed"/>
/// </remarks>
[JsonPropertyName( "suppressed" )]
[JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )]
public EmailFailedData? Suppressed { get; set; }
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
}


Expand Down Expand Up @@ -82,4 +110,27 @@ public class EmailClickData
/// <summary />
[JsonPropertyName( "userAgent" )]
public string UserAgent { get; set; } = default!;
}


/// <summary />
public class EmailFailedData
{
/// <summary />
[JsonPropertyName( "reason" )]
public string Reason { get; set; } = default!;
}


/// <summary />
public class EmailSuppressedData
{
/// <summary />
[JsonPropertyName( "message" )]
public string Message { get; set; } = default!;

/// <summary />
/// <remarks>TODO: What are the possible values?</remarks>
[JsonPropertyName( "type" )]
public string Type { get; set; } = default!;
}