Skip to Content
0
Former Member
Jun 07, 2013 at 10:55 PM

Send automatically notification email

66 Views

Hi Everybody

I'm investigating about how to send notifications mails after an operation, I found a BO named "EmailActivity", apply the example code but I don't understand where it takes the mail I don't have errors in the syntaxis, but in the moment of run the code shows this message:

import ABSL;
import AP.FO.Activity.Global;

//EmailActivity: Root node
var elEmailRoot : elementsof EmailActivity;
var instEmail;

// EmailActivity: define party node
var elEmailParty : elementsof EmailActivity.Party;
var instParty;

// EmailActivity: define service order text collection
var TXT_TYPE_BODY_TEXT = "10002";
var elEmailTxtCollTxt: elementsof EmailActivity.TextCollection.Text;
var elEmailTxtCollTxtCntnt: elementsof EmailActivity.TextCollection.Text.TextContent;
var instEmailTxtColl;
var instEmailTxtCollTxt;

// EmailActivity: maintain description - mandatory
elEmailRoot.Name.content = "PSM CRM ABSL Test - CallEmailExample Example_01";

// EmailActivity: create new instance
instEmail = EmailActivity.Create(elEmailRoot);

// Email: Organizer party - mandatory
if (! instEmail.MessageFromParty.IsSet()) {

elEmailParty.PartyKey.PartyID.content = "00163E0312B41EE2B3A85F4B8DB6EEFE";
//elEmailParty.AddressReference.AddressHostUUID.content

instEmail.MessageFromParty.Create(elEmailParty);
}


// Email: Set Employee Responsible mandatory
if (! instEmail.EmployeeResponsibleParty.IsSet()) {
elEmailParty.PartyKey.PartyID.content = "00163E0312B41EE2B3DA1D0FADD9E7FB"; // Set Employee ID
instEmail.EmployeeResponsibleParty.Create(elEmailParty);
}

// Create a text of type "Body Text"
instEmailTxtColl = instEmail.TextCollection.Create();
elEmailTxtCollTxt.TypeCode.content = TXT_TYPE_BODY_TEXT;
instEmailTxtCollTxt = instEmailTxtColl.Text.Create(elEmailTxtCollTxt);
elEmailTxtCollTxtCntnt.Text.content = "Texto del e-mail";
instEmailTxtCollTxt.TextContent.Create(elEmailTxtCollTxtCntnt);

How to send automatically notification email?

Attachments

error.jpg (44.5 kB)