Skip to content

Commit

Permalink
feat: add caption on MMS attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Aug 8, 2024
1 parent 0c57c3f commit f388e83
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"webhook_version": "v1",
"webhook_url": "https://example.com/status",
"image": {
"url": "https://test.com/image.png"
"url": "https://test.com/image.png",
"caption": "Caption"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"webhook_version": "v1",
"webhook_url": "https://example.com/status",
"image": {
"url": "https://test.com/image.png"
"url": "https://test.com/image.png",
"caption": "Caption"
},
"ttl": 600
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"webhook_version": "v1",
"webhook_url": "https://example.com/status",
"vcard": {
"url": "https://test.com/contact.vcf"
"url": "https://test.com/contact.vcf",
"caption": "Caption"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"webhook_version": "v1",
"webhook_url": "https://example.com/status",
"vcard": {
"url": "https://test.com/contact.vcf"
"url": "https://test.com/contact.vcf",
"caption": "Caption"
},
"ttl": 600
}
4 changes: 4 additions & 0 deletions Vonage.Test/Messages/Mms/MmsMessagesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public async Task SendMmsImageAsyncReturnsOk()
Image = new Attachment
{
Url = "https://test.com/image.png",
Caption = "Caption",
},
ClientRef = "abcdefg",
WebhookUrl = new Uri("https://example.com/status"),
Expand All @@ -104,6 +105,7 @@ public async Task SendMmsImageAsyncReturnsOkWithTtl()
Image = new Attachment
{
Url = "https://test.com/image.png",
Caption = "Caption",
},
ClientRef = "abcdefg",
WebhookUrl = new Uri("https://example.com/status"),
Expand All @@ -123,6 +125,7 @@ public async Task SendMmsVcardAsyncReturnsOk()
Vcard = new Attachment
{
Url = "https://test.com/contact.vcf",
Caption = "Caption",
},
ClientRef = "abcdefg",
WebhookUrl = new Uri("https://example.com/status"),
Expand All @@ -141,6 +144,7 @@ public async Task SendMmsVcardAsyncReturnsOkWithTtl()
Vcard = new Attachment
{
Url = "https://test.com/contact.vcf",
Caption = "Caption",
},
ClientRef = "abcdefg",
WebhookUrl = new Uri("https://example.com/status"),
Expand Down
5 changes: 5 additions & 0 deletions Vonage/Messages/Attachment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ public class Attachment
/// The URL of the attachment.
/// </summary>
public string Url { get; set; }

/// <summary>
/// Additional text
/// </summary>
public string Caption { get; set; }
}

0 comments on commit f388e83

Please sign in to comment.