Created
November 16, 2017 16:52
-
-
Save cgillis-aras/d181a4be5da1ffbc060c618fbbc2de42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Innovator inn=this.getInnovator(); | |
// *** Express ECO ********************************************************* // | |
Item hd= inn.newItem("Express ECO","get"); | |
hd.setID(this.getID()); | |
hd.setAttribute("select","item_number,title,eco_type,team_id"); | |
hd = hd.apply(); | |
// *** Email From ********************************************************** // | |
Item innAdm= inn.newItem("User","get"); | |
innAdm.setAttribute("select","first_name,last_name,email"); | |
innAdm.setProperty("login_name","admin"); | |
innAdm=innAdm.apply(); | |
// *** Email To ************************************************************ // | |
Item toUser1= inn.newItem("team identity","get"); | |
toUser1.setAttribute("select","related_id"); | |
toUser1.setProperty("source_id",hd.getProperty("team_id")); | |
toUser1.setProperty("team_role","6D22DAAF10654038B177A60785E4AA8D"); | |
toUser1=toUser1.apply(); | |
Item toUser= inn.newItem("User","get"); | |
toUser.setAttribute("select","email"); | |
toUser.setProperty("owned_by_id",toUser1.getProperty("related_id")); | |
toUser=toUser.apply(); | |
// *** Email Information *************************************************** // | |
string from_user=innAdm.getProperty("email"); | |
string from_userN = innAdm.getProperty("first_name")+ " " + innAdm.getProperty("last_name"); | |
System.Net.Mail.MailMessage MyMessage = new System.Net.Mail.MailMessage(); | |
for (int i = 0; i < toUser.getItemCount(); i++) { | |
// Add the recipients to the email | |
MyMessage.To.Add(toUser.getItemByIndex(i).getProperty("email")); | |
} | |
string emBody= "<body>You have been identified as one of the members of the Configuration Management Team for this ECP." | |
+ "<br>" | |
; | |
System.Net.Mail.MailAddress SendFrom = new System.Net.Mail.MailAddress(from_user,from_userN); | |
MyMessage.From = SendFrom; | |
MyMessage.Subject = "ECP Number: " + hd.getProperty("item_number"); | |
MyMessage.IsBodyHtml = true; | |
MyMessage.Body = emBody; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment