Skip to content

Commit

Permalink
added WebMethod EmailSnippetToO2Support (currently used on Snippet Save)
Browse files Browse the repository at this point in the history
  • Loading branch information
DinisCruz committed Oct 15, 2012
1 parent f4c78b5 commit 333967f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions App_Code/Global.asax.cs
Expand Up @@ -24,8 +24,7 @@ protected void Application_Start (object sender, EventArgs e)
protected void Session_Start (object sender, EventArgs e) { }

protected void Application_BeginRequest (object sender, EventArgs e)
{
"[Application_BeginRequest]".info();
{
var rawRequest = Request.Url.AbsolutePath.removeFirstChar();
if (rawRequest.isInt())
Server.Transfer("/Pages/Repl.html");
Expand Down
13 changes: 13 additions & 0 deletions App_Code/WebService.cs
Expand Up @@ -10,6 +10,7 @@
using O2.Kernel;
using O2.Kernel.InterfacesBaseImpl;
using System.Text;
using O2.DotNetWrappers.Network;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
Expand Down Expand Up @@ -111,6 +112,9 @@ public int SaveSnippet(string snippet)
{
snippet.saveAs(targetFile);
"[SaveSnippet] snippet saved to: {0}".format(targetFile);

EmailSnippetToO2Support("Script saved on C# WEB REPL with id: " + id, snippet);

return id;
}
return -1;
Expand All @@ -134,4 +138,13 @@ public string GetO2Logs()
return logData.str();
}


[WebMethod(EnableSession = true)]
public void EmailSnippetToO2Support(string subject, string snippet)
{
var text = LogRequest(snippet).serialize(false);
Mail.sendMail(PublicDI.sEmailHost, "support@o2platform.com", "support@o2platform.com", "",
"[WebRepl]" + subject,
text, new List<string>(), false);
}
}

0 comments on commit 333967f

Please sign in to comment.