Anonymous Posted May 3, 2012 Report Share Posted May 3, 2012 I'm attempting to create a command that emails me upon the completion of an update (this would be a nice feature to see natively in Ketarin). The problem: the email I receive shows the unresolved variable names. In the execute after the download section, I have the following C# script: System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.To.Add("email_address@domain.com"); message.Subject = "{appname} has been updated to {version}"; message.From = new System.Net.Mail.MailAddress("email_address@domain.com"); message.Body = "SHA256: {sha256}"; System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.domain.com"); smtp.Send(message); The log (collected by running as Batch script) shows: 5/3/2012 1:45:53 PM: LibreOffice: Replacing {version} in 'System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.To.Add("email_address@domain.com"); message.Subject = "LibreOffice has been updated to {version}"; message.From = new System.Net.Mail.MailAddress("email_address@domain.com"); message.Body = "SHA256: {sha256}"; System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.domain.com"); smtp.Send(message);' with '3.5.3' 5/3/2012 1:45:53 PM: LibreOffice: Replacing {version} in 'http://download.documentfoundation.org/libreoffice/stable/{version}/win/x86/LibO_{version}_Win_x86_install_multi.msi.sha256' with '3.5.3' 5/3/2012 1:45:54 PM: LibreOffice: Replacing {sha256} in 'System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.To.Add("email_address@domain.com"); message.Subject = "LibreOffice has been updated to 3.5.3"; message.From = new System.Net.Mail.MailAddress("email_address@domain.com"); message.Body = "SHA256: {sha256}"; System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.domain.com"); smtp.Send(message);' with '163e4de6f6eb3a2d85427d1989926b896abd688b3a069ab1552540c21c3afcf2' 5/3/2012 1:45:54 PM: LibreOffice: Executing command: System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); 5/3/2012 1:45:54 PM: LibreOffice: Executing command: message.To.Add("email_address@domain.com"); 5/3/2012 1:45:54 PM: LibreOffice: Executing command: message.Subject = "LibreOffice has been updated to 3.5.3"; 5/3/2012 1:45:54 PM: LibreOffice: Executing command: message.From = new System.Net.Mail.MailAddress("email_address@domain.com"); 5/3/2012 1:45:54 PM: LibreOffice: Executing command: message.Body = "SHA256: 163e4de6f6eb3a2d85427d1989926b896abd688b3a069ab1552540c21c3afcf2"; 5/3/2012 1:45:54 PM: LibreOffice: Executing command: System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.domain.com"); 5/3/2012 1:45:54 PM: LibreOffice: Executing command: smtp.Send(message); 5/3/2012 1:45:54 PM: LibreOffice: Command result: Microsoft Windows [Version 6.1.7601] Are variables supposed to resolve when running a C# script, or is this just a pipe dream? Link to comment Share on other sites More sharing options...
shawn Posted May 5, 2012 Report Share Posted May 5, 2012 Variables are supposed to resolve. Which build are you using? Link to comment Share on other sites More sharing options...
Anonymous Posted May 7, 2012 Author Report Share Posted May 7, 2012 I was using 1.6.0.434, but just tried it in 1.6.1-b2 and received the same results. Link to comment Share on other sites More sharing options...
shawn Posted May 10, 2012 Report Share Posted May 10, 2012 Flo - this is definitely a bug. Link to comment Share on other sites More sharing options...
floele Posted June 17, 2012 Report Share Posted June 17, 2012 Oh, you are using a C# script. Nice. But it won't work that way You need to do it this way: x = app.Variables.ReplaceAllInString("This is my {variable} string") or like this: x = UrlVariable.GlobalVariables.ReplaceAllInString("This is my {variable} string") Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now