Index: vhDeploy/WV/Deploy20111011x1316.cls.xml
===================================================================
diff -u
--- vhDeploy/WV/Deploy20111011x1316.cls.xml (revision 0)
+++ vhDeploy/WV/Deploy20111011x1316.cls.xml (revision 2323)
@@ -0,0 +1,32 @@
+
+
+
+
+Added by WimV
+1
+svn.Deploy
+0
+
+
+1
+
+
+
+
Index: vhLib/Mail.mac.rou
===================================================================
diff -u -r762 -r2323
--- vhLib/Mail.mac.rou (.../Mail.mac.rou) (revision 762)
+++ vhLib/Mail.mac.rou (.../Mail.mac.rou) (revision 2323)
@@ -46,12 +46,32 @@
. Do MM.To.Insert($LI(To,Loop))
If $D(ccTo) Do
. For Loop=1:1:$LL(ccTo) Do
- .. Do MM.Cc.Insert($LI(ccTo,Loop))
+ . . Do MM.Cc.Insert($LI(ccTo,Loop))
If $D(BccTo) Do
. For Loop=1:1:$LL(BccTo) Do
- .. Do MM.Bcc.Insert($LI(BccTo,Loop))
+ . . Do MM.Bcc.Insert($LI(BccTo,Loop))
+
Set MM.ReplyTo=$G(ReplyTo)
Set MM.Subject=Subject
+
+ // Added by WimV on 11/10/2011
+ New RecipientsInfo,RedirectTo
+ Set RecipientsInfo=""
+ If ##class(TECH.Config.ConfigMgr).Instance().GetBoolean("vhLib.Mail_RedirectMailToDevelopment") {
+ // Override mail recipients, stuur mail naar de actieve gebruiker (bedoeld voor test- en development-omgevingen)
+ Set RecipientsInfo=$$GeefRecipientsInfo(MM)
+ Set RedirectTo=$$GeefMailAdresFromRuntimeContext()
+ Set:(RedirectTo="") RedirectTo=##class(TECH.Config.ConfigMgr).Instance().GetString("TECH.Error.impl.ErrorHandler_DefaultMailAddress")
+ Do MM.To.Clear()
+ Do MM.Cc.Clear()
+ Do MM.Bcc.Clear()
+ Do MM.To.Insert(RedirectTo)
+ }
+ If $L(RecipientsInfo) {
+ Do MM.TextData.Write(RecipientsInfo)
+ Do MM.TextData.WriteLine()
+ }
+
If BodyIsStream Do
. Do MM.TextData.CopyFrom(Body)
Else Do
@@ -71,12 +91,62 @@
Quit:($$$ISERR(Status)) Status
+ Do MaakEmailAdressenAtVanhoeckeBe(MM) ; Added by WimV on 11/10/2011
+
Set Status=SMTP.Send(MM)
do MM.%Close()
do SMTP.%Close()
Quit Status
+MaakEmailAdressenAtVanhoeckeBe(MailMessage)
+ // De EmailAdressen controleren op aanwezigheid van het "@"-teken, en indien nodig aanvullen met "@vanhoecke.be"
+ // Bvb als alleen initialen zijn opgegeven, dit is geen geldig email-adres
+ Do MaakRecipientsAtVanhoeckeBe(MailMessage.To)
+ Do MaakRecipientsAtVanhoeckeBe(MailMessage.Cc)
+ Do MaakRecipientsAtVanhoeckeBe(MailMessage.Bcc)
+ Set MailMessage.From=$$GeefVolledigEmailAdres(MailMessage.From)
+ Set MailMessage.Sender=$$GeefVolledigEmailAdres(MailMessage.Sender)
+ Set MailMessage.ReplyTo=$$GeefVolledigEmailAdres(MailMessage.ReplyTo)
+ Quit
+MaakRecipientsAtVanhoeckeBe(ListOfRecipients)
+ New i,Recipient,IsEmailAdresGewijzigd
+ If $IsObject(ListOfRecipients) {
+ For i=1:1:ListOfRecipients.Count() {
+ Set Recipient=$$GeefVolledigEmailAdres(ListOfRecipients.GetAt(i), .IsEmailAdresGewijzigd)
+ Do:(IsEmailAdresGewijzigd) ListOfRecipients.SetAt(Recipient,i)
+ }
+ }
+ Quit
+
+GeefVolledigEmailAdres(EmailAdres, IsEmailAdresGewijzigd) ; IsEmailAdresGewijzigd als .local doorgeven
+ Set IsEmailAdresGewijzigd=0
+ If ($L(EmailAdres))&&(EmailAdres'["@") {
+ Set EmailAdres=EmailAdres_"@vanhoecke.be"
+ Set IsEmailAdresGewijzigd=1
+ }
+ Quit EmailAdres
+
+
+GeefRecipientsInfo(MailMessage)
+ #define ListHasItems(%v) ($IsObject(%v))&&(%v.Count()>0)
+ New RecipientsInfo
+ Set RecipientsInfo="Intended Recipients : (redirected by configitem vhLib.Mail_RedirectMailToDevelopment)"_$$$CRLF
+ Set:($$$ListHasItems(MailMessage.To) ) RecipientsInfo=RecipientsInfo_" To : "_##class(TECH.ListUtils).ListToPieces(MailMessage.To,", ")_$$$CRLF
+ Set:($$$ListHasItems(MailMessage.Cc) ) RecipientsInfo=RecipientsInfo_" Cc : "_##class(TECH.ListUtils).ListToPieces(MailMessage.Cc,", ")_$$$CRLF
+ Set:($$$ListHasItems(MailMessage.Bcc)) RecipientsInfo=RecipientsInfo_" Bcc : "_##class(TECH.ListUtils).ListToPieces(MailMessage.Bcc,", ")_$$$CRLF
+ Quit RecipientsInfo
+
+GeefMailAdresFromRuntimeContext()
+ New RedirectTo
+ Set RedirectTo=##class(TECH.Context.RuntimeContext).Instance().GeefGebruikerInitialen()
+ If $E(RedirectTo,1,3)="SYS" {
+ Set RedirectTo=""
+ }
+ ;Set RedirectTo=$$GeefVolledigEmailAdres(RedirectTo) ; Wordt sowieso aangepast door method MaakEmailAdressenAtVanhoeckeBe()
+ Quit RedirectTo
+
+
// SendMiniMail eXtended :
// Replace the domain "vanhoecke.be" in if also contains "vanhoecke.be" domain(s)
SendMiniMailXtd(From,lbTo,Subject,Body,BodyIsStream,Args6,Args7,Args8,lbAttachments,Args10) ; ,Args11,Args12)