/// <summary> /// Parent Constructor /// </summary> /// <param name="parent">Mail message</param> /// <param name="AD_User_ID">recipient user</param> /// <param name="mail"> email</param> public MUserMail(MMailMsg parent, int AD_User_ID, EMail mail) : this(parent.GetCtx(), 0, parent.Get_TrxName()) { SetClientOrg(parent); SetAD_User_ID(AD_User_ID); SetW_MailMsg_ID(parent.GetW_MailMsg_ID()); // if (mail.IsSentOK()) { SetMessageID(mail.GetMessageID()); } else { SetMessageID(mail.GetSentMsg()); SetIsDelivered(ISDELIVERED_No); } }
} // getMailMsg /// <summary> /// Create (missing) Messages /// </summary> /// <returns>number of messages created</returns> public int CreateMessages() { String[][] initMsgs = new String[][] { new String[] { MMailMsg.MAILMSGTYPE_UserVerification, "EMail Verification", "EMail Verification ", "Dear ", "\nYou requested the Verification Code: ", "\nPlease enter the verification code to get access." }, new String[] { MMailMsg.MAILMSGTYPE_UserPassword, "Password Request", "Password Request ", "Dear ", "\nWe received a 'Send Password' request from: ", "\nYour password is: " }, new String[] { MMailMsg.MAILMSGTYPE_Subscribe, "Subscription New", "New Subscription ", "Dear ", "\nYou requested to be added to the list: ", "\nThanks for your interest." }, new String[] { MMailMsg.MAILMSGTYPE_UnSubscribe, "Subscription Removed", "Remove Subscription ", "Dear ", "\nYou requested to be removed from the list: ", "\nSorry to see you go. This is effictive immediately." }, new String[] { MMailMsg.MAILMSGTYPE_OrderAcknowledgement, "Order Acknowledgement", "Vienna Web - Order ", "Dear ", "\nThank you for your purchase: ", "\nYou can view your Orders, Invoices, Payments in the Web Store." + "\nFrom there, you also download your Assets (Documentation, etc.)" }, new String[] { MMailMsg.MAILMSGTYPE_PaymentAcknowledgement, "Payment Success", "Vienna Web - Payment ", "Dear ", "\nThank you for your payment of ", "\nYou can view your Orders, Invoices, Payments in the Web Store." + "\nFrom there you also download your Assets (Documentation, etc.)" }, new String[] { MMailMsg.MAILMSGTYPE_PaymentError, "Payment Error", "Vienna Web - Declined Payment ", "Dear ", "\nUnfortunately your payment was declined: ", "\nPlease check and try again. You can pay later by going to 'My Orders' or 'My Invoices' - or by directly creating a payment in 'My Payments'" }, new String[] { MMailMsg.MAILMSGTYPE_Request, "Request", "Request ", "Dear ", "\nThank you for your request: " + MRequest.SEPARATOR, MRequest.SEPARATOR + "\nPlease check back for updates." }, new String[] { MMailMsg.MAILMSGTYPE_UserAccount, "Welcome Message", "Welcome", "Welcome to our Web Store", "This is the Validation Code to access information:", "" }, }; if (m_msgs == null) { GetMailMsgs(false); } if (m_msgs.Length == initMsgs.Length) // may create a problem if user defined own ones - unlikely { return(0); // nothing to do } int counter = 0; for (int i = 0; i < initMsgs.Length; i++) { Boolean found = false; for (int m = 0; m < m_msgs.Length; m++) { if (initMsgs[i][0].Equals(m_msgs[m].GetMailMsgType())) { found = true; break; } } // for all existing msgs if (found) { continue; } MMailMsg msg = new MMailMsg(this, initMsgs[i][0], initMsgs[i][1], initMsgs[i][2], initMsgs[i][3], initMsgs[i][4], initMsgs[i][5]); if (msg.Save()) { counter++; } else { log.Severe("Not created MailMsgType=" + initMsgs[i][0]); } } // for all initMsgs log.Info("#" + counter); m_msgs = null; // reset return(counter); } // createMessages