Skip to content

Commit

Permalink
Updated webmatrix lib to use new Messages endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Devin Rader committed Oct 6, 2014
1 parent a45550c commit d279041
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Twilio.WebMatrix.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>Twilio.WebMatrix</id>
<version>3.1.3</version>
<version>3.1.4</version>
<authors>Twilio</authors>
<description>Twilio helpers for WebMatrix and ASP.NET Web Pages</description>
<language>en-US</language>
Expand All @@ -13,5 +13,8 @@
<dependencies>
<dependency id="Twilio" />
</dependencies>
<releaseNotes>
* 3.1.4 - Depricated SendSmsMessage. Added replacement SendMessage method which uses newer Messages endpoint
</releaseNotes>
</metadata>
</package>
17 changes: 17 additions & 0 deletions src/Twilio.WebMatrix/Twilio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class Twilio
/// <param name="body">The contents of the message, up to 160 characters</param>
/// <param name="statusCallbackUrl">The URL to notify of the message status</param>
/// <returns>An SMSMessage Instance resource</returns>
[Obsolete]
public static SMSMessage SendSms(string from, string to, string body, string statusCallbackUrl)
{
CheckForCredentials();
Expand All @@ -34,6 +35,22 @@ public static SMSMessage SendSms(string from, string to, string body, string sta
return twilio.SendSmsMessage(from, to, body, statusCallbackUrl);
}

/// <summary>
/// Send an message
/// </summary>
/// <param name="from">The number to send the message from</param>
/// <param name="to">The number to send the message to</param>
/// <param name="body">The contents of the message, up to 160 characters</param>
/// <param name="statusCallbackUrl">The URL to notify of the message status</param>
/// <returns>An Message Instance resource</returns>
public static Message SendMessage(string from, string to, string body, string statusCallbackUrl)
{
CheckForCredentials();

var twilio = new TwilioRestClient(AccountSid, AuthToken);
return twilio.SendMessage(from, to, body, statusCallbackUrl);
}

/// <summary>
/// Initiate a new outgoing call
/// </summary>
Expand Down

0 comments on commit d279041

Please sign in to comment.