33using System . Data ;
44using System . IO ;
55using System . Net . Mail ;
6+ using System . Runtime . CompilerServices ;
67using System . Text ;
78using System . Web ;
89using System . Xml ;
910using System . Xml . Xsl ;
11+ using DotNetNuke . Abstractions . Portals ;
1012using DotNetNuke . Common ;
1113using DotNetNuke . Entities . Host ;
1214using DotNetNuke . Modules . UserDefinedTable . Interfaces ;
@@ -24,13 +26,13 @@ public enum Trigger
2426 Delete
2527 }
2628
27- public static void OnAction ( Trigger trigger , int rowId , UserDefinedTableController udtC )
29+ public static void OnAction ( Trigger trigger , int rowId , UserDefinedTableController udtC , string httpAlias )
2830 {
2931 if ( ActionIsTriggered ( trigger , udtC . Settings ) )
3032 {
3133 var ds = udtC . GetRow ( rowId , true , true ) ;
3234 ds . Tables . Add ( udtC . Context ( ) ) ;
33- HandleAction ( trigger , ds , udtC ) ;
35+ HandleAction ( trigger , ds , udtC , httpAlias ) ;
3436 }
3537 }
3638
@@ -43,7 +45,7 @@ static bool ActionIsTriggered(Trigger trigger, Settings settings)
4345 }
4446
4547
46- static void HandleAction ( Trigger trigger , DataSet data , UserDefinedTableController udtC )
48+ static void HandleAction ( Trigger trigger , DataSet data , UserDefinedTableController udtC , string httpAlias )
4749 {
4850 var settings = udtC . Settings ;
4951 var subject = settings . TrackingSubject ;
@@ -85,7 +87,7 @@ static void HandleAction(Trigger trigger, DataSet data, UserDefinedTableControll
8587 subject =
8688 ( ( new TokenReplace ( ) ) . ReplaceEnvironmentTokens ( subject , data . Tables [ DataSetTableName . Data ] . Rows [ 0 ] ) ) ;
8789
88- SendMail ( from , mailTo , cc , bcc , replyto , subject , data . GetXml ( ) , message , triggerMessage , script ) ;
90+ SendMail ( from , mailTo , cc , bcc , replyto , subject , data . GetXml ( ) , message , triggerMessage , script , httpAlias ) ;
8991 }
9092
9193
@@ -123,7 +125,7 @@ static string GetEmailAddressList(string mailto, DataSet data)
123125 }
124126
125127 static void SendMail ( string from , string mailTo , string cc , string bcc , string replyto , string subject ,
126- string data , string message , string trigger , string script )
128+ string data , string message , string trigger , string script , string httpAlias )
127129 {
128130 var xslTrans = new XslCompiledTransform ( ) ;
129131 xslTrans . Load ( HttpContext . Current . Server . MapPath ( script ) ) ;
@@ -143,12 +145,12 @@ static void SendMail(string from, string mailTo, string cc, string bcc, string r
143145 var body = bodyTextWriter . ToString ( ) ;
144146 body = body . Replace ( "href=\" /" ,
145147 string . Format ( "href=\" http://{0}/" ,
146- Globals . GetPortalSettings ( ) . PortalAlias . HTTPAlias . Split ( '/' ) [ 0 ] ) ) ;
148+ httpAlias . Split ( '/' ) [ 0 ] ) ) ;
147149 body = body . Replace ( "src=\" /" ,
148150 string . Format ( "src=\" http://{0}/" ,
149- Globals . GetPortalSettings ( ) . PortalAlias . HTTPAlias . Split ( '/' ) [ 0 ] ) ) ;
151+ httpAlias . Split ( '/' ) [ 0 ] ) ) ;
150152
151- var noAttachments = new List < Attachment > ( ) ;
153+ var noAttachments = new List < MailAttachment > ( ) ;
152154 Mail . SendMail ( from , mailTo , cc , bcc , replyto , MailPriority . Normal , subject , MailFormat . Html ,
153155 Encoding . UTF8 , body , noAttachments , "" , "" , "" , "" , Host . EnableSMTPSSL ) ;
154156 }
0 commit comments