Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Gemini 5: @Html.Raw() does not work with Stream service

admin
emails

When we create an email Alert Template holding the code @Html.Raw(item.LastComment), no emails are sent and we get an error message in the event log.

If we only use @(item.LastComment), then it works fine (but then html tags are included in the email text).

Is it not possible to use the @Html.Raw() function together with the Stream service?

Marcus Antonsson
· 50
Marcus Antonsson
Replies (5)
helpful
0
not helpful

What error do you get in event viewer?


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Copy from the event viewer (please let me know if you prefer the error text in an email):

Countersoft.Foundation.Web.Mvc - Line: 220   Col: 38     Error: The type 'System.Web.IHtmlString' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.1 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------

namespace Countersoft.Foundation.Web.Mvc.Razor { using System;

public class Rzra8ae7f7109cd451083d2029ad8bb7ef0Template : Countersoft.Foundation.Web.Mvc.Razor.RazorTemplateBase<Countersoft.Gemini.Mailer.AlertTypeAppNavAlertsTemplateModel> {

line hidden

    public Rzra8ae7f7109cd451083d2029ad8bb7ef0Template() {
    }

    public override void Execute() {

WriteLiteral("

WriteLiteral(" style=\"width: 100%; font-family: arial; font-size: 16px; font-weight: bold; bord" + "er: none; background-color: #8f0929;\"");

WriteLiteral(" cellpadding=\"20\"");

WriteLiteral(">\r\n\r\n\r\n

WriteLiteral(" style=\"color: white;\"");

WriteLiteral(">CONDESIGN TRACKER\r\n\r\n\r\n\r\n\r\n

WriteLiteral(" style=\"width: 100%; font-family: arial; font-size: 13px; font-weight: normal; bo" + "rder: none; background-color: white;\"");

WriteLiteral(" cellpadding=\"10\"");

WriteLiteral(">\r\n\r\n\r\n

WriteLiteral(" style=\"color: #4c4c4c;\"");

WriteLiteral(">Just to let you know that there are ");

                                                                Write(Model.ChangeCount);

WriteLiteral(" changes to your ");

                                                                                                                       Write(Model.CardTitle);

WriteLiteral(" AppNav card.\r\n\r\n\r\n\r\n\r\n");

if (Model.TheItemsCreated.Count > 0) {

WriteLiteral("\t

WriteLiteral(" style=\"margin: 10px 0 10px 20px;\"");

WriteLiteral(">New\r\n");

WriteLiteral("\t

WriteLiteral(" style=\"margin-left: 40px; font-family: arial; font-size: 13px; font-weight: norm" + "al; border: none; background-color: white; border-collapse: collapse;\"");

WriteLiteral(" cellpadding=\"10\"");

WriteLiteral(">\r\n\t\t\r\n");

foreach(var item in Model.TheItemsCreated) {

WriteLiteral("\t\t\r\n\t\t\t

WriteLiteral(" style=\"color: #4c4c4c; border: 1px solid #f5f5f5; background-color: #f5f5f5; fon" + "t-weight: bold; font-size: 13px;\"");

WriteLiteral(">Name:\r\n\t\t\t

WriteLiteral(" style=\"border: 1px solid #f5f5f5;\"");

WriteLiteral(">

WriteAttribute("href", Tuple.Create(" href=\"", 1132), Tuple.Create("\"", 1232) , Tuple.Create(Tuple.Create("", 1139), Tuple.Create(Model.GeminiUrl , 1139), false) , Tuple.Create(Tuple.Create("", 1157), Tuple.Create("project/", 1157), true) , Tuple.Create(Tuple.Create("", 1165), Tuple.Create(item.ProjectCode , 1165), false) , Tuple.Create(Tuple.Create("", 1184), Tuple.Create("/", 1184), true) , Tuple.Create(Tuple.Create("", 1185), Tuple.Create(item.Entity.ProjectId , 1185), false) , Tuple.Create(Tuple.Create("", 1209), Tuple.Create("/item/", 1209), true) , Tuple.Create(Tuple.Create("", 1215), Tuple.Create(item.Entity.Id , 1215), false) );

WriteLiteral(">");

                                                                                                                                          Write(item.IssueKey);

WriteLiteral(" ");

                                                                                                                                                                    Write(item.Title);

WriteLiteral("\r\n\t\t\r\n");

WriteLiteral("\t\t\r\n\t\t\t

WriteLiteral(" style=\"color: #4c4c4c; border: 1px solid #f5f5f5; background-color: #f5f5f5; fon" + "t-weight: bold; font-size: 13px;\"");

WriteLiteral(">Status:\r\n\t\t\t

WriteLiteral(" style=\"border: 1px solid #f5f5f5;\"");

WriteLiteral(">");

                                  Write(item.Status);

WriteLiteral("\r\n\t\t\r\n");

WriteLiteral("\t\t\r\n");

}

WriteLiteral("\t\r\n\t\r\n");

}

WriteLiteral("\r\n");

if (Model.TheItemsUpdated.Count > 0) {

WriteLiteral("\t

WriteLiteral(" style=\"margin: 10px 0 10px 20px;\"");

WriteLiteral(">Changed\t\r\n");

WriteLiteral("\t

WriteLiteral(" style=\"margin-left: 40px; font-family: arial; font-size: 13px; font-weight: norm" + "al; border: none; background-color: white; border-collapse: collapse;\"");

WriteLiteral(" cellpadding=\"10\"");

WriteLiteral(">\r\n\t\t\r\n");

foreach(var item in Model.TheItemsUpdated) {

WriteLiteral("\t\t\r\n\t\t\t

WriteLiteral(" style=\"color: #4c4c4c; border: 1px solid #f5f5f5; background-color: #f5f5f5; fon" + "t-weight: bold; font-size: 13px;\"");

WriteLiteral(">Name:\r\n\t\t\t

WriteLiteral(" style=\"border: 1px solid #f5f5f5;\"");

WriteLiteral(">

WriteAttribute("href", Tuple.Create(" href=\"", 2111), Tuple.Create("\"", 2211) , Tuple.Create(Tuple.Create("", 2118), Tuple.Create(Model.GeminiUrl , 2118), false) , Tuple.Create(Tuple.Create("", 2136), Tuple.Create("project/", 2136), true) , Tuple.Create(Tuple.Create("", 2144), Tuple.Create(item.ProjectCode , 2144), false) , Tuple.Create(Tuple.Create("", 2163), Tuple.Create("/", 2163), true) , Tuple.Create(Tuple.Create("", 2164), Tuple.Create(item.Entity.ProjectId , 2164), false) , Tuple.Create(Tuple.Create("", 2188), Tuple.Create("/item/", 2188), true) , Tuple.Create(Tuple.Create("", 2194), Tuple.Create(item.Entity.Id , 2194), false) );

WriteLiteral(">");

                                                                                                                                          Write(item.IssueKey);

WriteLiteral(" ");

                                                                                                                                                                    Write(item.Title);

WriteLiteral("\r\n\t\t\r\n");

WriteLiteral("\t\t\r\n\t\t\t

WriteLiteral(" style=\"color: #4c4c4c; border: 1px solid #f5f5f5; background-color: #f5f5f5; fon" + "t-weight: bold; font-size: 13px;\"");

WriteLiteral(">Status:\r\n\t\t\t

WriteLiteral(" style=\"border: 1px solid #f5f5f5;\"");

WriteLiteral(">");

                                  Write(item.Status);

WriteLiteral("\r\n\t\t\r\n");

WriteLiteral("\t\t\r\n\t\t\t

WriteLiteral(" style=\"color: #4c4c4c; border: 1px solid #f5f5f5; background-color: #f5f5f5; fon" + "t-weight: bold; font-size: 13px;\"");

WriteLiteral(">Last comment:\r\n\t\t\t

WriteLiteral(" style=\"border: 1px solid #f5f5f5;\"");

WriteLiteral(">");

                                 Write(Html.Raw(item.LastComment));

WriteLiteral("\r\n\t\t\r\n");

WriteLiteral("\t\t\r\n");

}

WriteLiteral("\t\r\n\t\t\r\n");

}

WriteLiteral("\r\n");

if (Model.TheItemsCommented.Count > 0) {

WriteLiteral("\t

WriteLiteral(" style=\"margin: 10px 0 10px 20px;\"");

WriteLiteral(">Commented\t\r\n");

WriteLiteral("\t

WriteLiteral(" style=\"margin-left: 40px; font-family: arial; font-size: 13px; font-weight: norm" + "al; border: none; background-color: white; border-collapse: collapse;\"");

WriteLiteral(" cellpadding=\"10\"");

WriteLiteral(">\r\n\t\t\r\n");

foreach(var item in Model.TheItemsCommented) {

WriteLiteral("\t\t\r\n\t\t\t

WriteLiteral(" style=\"color: #4c4c4c; border: 1px solid #f5f5f5; background-color: #f5f5f5; fon" + "t-weight: bold; font-size: 13px;\"");

WriteLiteral(">");

                                                                                                                 Write(item.Comments[0].Entity.Fullname);

WriteLiteral("\r\n\t\t\t

WriteLiteral(" style=\"color: #4c4c4c; border: 1px solid #f5f5f5; font-weight: normal; font-size" + ": 12px;\"");

WriteLiteral(">\r\n\t\t\t

WriteAttribute("href", Tuple.Create(" href=\"", 3420), Tuple.Create("\"", 3529) , Tuple.Create(Tuple.Create("", 3427), Tuple.Create(Model.GeminiUrl , 3427), false) , Tuple.Create(Tuple.Create("", 3445), Tuple.Create("project/", 3445), true) , Tuple.Create(Tuple.Create("", 3453), Tuple.Create(item.ProjectCode , 3453), false) , Tuple.Create(Tuple.Create("", 3472), Tuple.Create("/", 3472), true) , Tuple.Create(Tuple.Create("", 3473), Tuple.Create(item.Entity.ProjectId , 3473), false) , Tuple.Create(Tuple.Create("", 3497), Tuple.Create("/item/", 3497), true) , Tuple.Create(Tuple.Create("", 3503), Tuple.Create(item.Entity.Id , 3503), false) , Tuple.Create(Tuple.Create("", 3520), Tuple.Create("#comments", 3520), true) );

WriteLiteral(">");

                                                                                                            Write(item.IssueKey);

WriteLiteral("\r\n\t\t\t ");

 Write(item.Title);

WriteLiteral("\r\n\t\t\r\n");

}

WriteLiteral("\t\r\n\t");

     }

WriteLiteral("\r\n

WriteLiteral(" style=\"font-family: arial; font-size: 13px; font-weight: normal; border: none; b" + "ackground-color: white;\"");

WriteLiteral(" cellpadding=\"10\"");

WriteLiteral(">\r\n\r\n\r\n

WriteLiteral(" style=\"color: #4c4c4c;\"");

WriteLiteral(">Thanks.\r\n\r\n\r\n\r\n

WriteLiteral(" style=\"width: 100%; font-family: arial; font-size: 11px; font-weight: normal; bo" + "rder: none; background-color: #8f0929;\"");

WriteLiteral(" cellpadding=\"5\"");

WriteLiteral(">\r\n\r\n\r\n

WriteLiteral(" style=\"color: white;\"");

WriteLiteral(">Sent by Condesign Issue Tracker System\r\n\r\n\r\n");

    }
}

} - at Countersoft.Foundation.Web.Mvc.Razor.Compiler.Compile(IEnumerable`1 entries) at Countersoft.Foundation.Web.Mvc.Razor.RazorTemplateGenerator.CompileTemplates() at Countersoft.Foundation.Web.Mvc.Razor.RazorCacheManager.Generate(HtmlHelper html, String templateName, String templateContents, Object parameter, Object resourceManager, Boolean debug) at Countersoft.Gemini.Mailer.AlertsTemplateHelper.GenerateHtml(AlertTemplate template, AlertTypeBaseTemplateModel model) at Countersoft.Gemini.Scheduler.Alerts.AlertsEngine.ProcessAppNavCardAlerts() at Countersoft.Gemini.Scheduler.Alerts.AlertsEngine.Process()


Marcus Antonsson
· 50
Marcus Antonsson
helpful
0
not helpful

Thank you, we have identified the issue and are working on a fix (should be out today / tomorrow).


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful
ANSWER

Please download the patch from: http://www.geminiplatform.com/downloads/v5/StreamPatchv512.zip unblock it and extract the files to the stream folder (overwrite existing ones). Please backup the folder before doing this.


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

It works perfectly. Again, thank you!


Marcus Antonsson
· 50
Marcus Antonsson