Send emails using Skip lists

Hello,

Do you have an example which describe a method to send emails to more users. The value of email address of users is stored inside an attribute of a module and as it's described in DXL help, should be used Skip lists. In which way the function sendEMailNotification can get the values from the Skip list, which are a list of email address separated by ";"...maybe you can help me with some code.

Thank you in advance,
Silvius
Silvius - Thu May 27 04:24:38 EDT 2010

Re: Send emails using Skip lists
llandale - Thu May 27 14:27:25 EDT 2010

I haven't actually done it, but surely each Skip List has Key and Data both the same string value, a single Email addresss. Surely, these two forms are acceptable: "John.Doe@Company.com" and "John Doe (John.Doe@Company.com)". So an outline of the guts of a script may look something like this:

Skip  skpTo = createString()
for every user I want the Email sent to
{  UserEmail = get the user's email
   put(skpTo, UserEmail, UserEmail)
}
sendEMailNotification(skpTo, ...)
delete(skpTo)


Are you saying you already have an attr-value containing the lists of Emails semi-colon separated: "John.Doe@TvRemote.com; Jane.Doe@Shopping.com"? If so, don't use the "Skip skpTo" version of sendEMailNotification, use the "string sTo" version.

 

 

  • Louie

 

 

Re: Send emails using Skip lists
Silvius - Tue Jun 01 10:00:30 EDT 2010

llandale - Thu May 27 14:27:25 EDT 2010

I haven't actually done it, but surely each Skip List has Key and Data both the same string value, a single Email addresss. Surely, these two forms are acceptable: "John.Doe@Company.com" and "John Doe (John.Doe@Company.com)". So an outline of the guts of a script may look something like this:

Skip  skpTo = createString()
for every user I want the Email sent to
{  UserEmail = get the user's email
   put(skpTo, UserEmail, UserEmail)
}
sendEMailNotification(skpTo, ...)
delete(skpTo)


Are you saying you already have an attr-value containing the lists of Emails semi-colon separated: "John.Doe@TvRemote.com; Jane.Doe@Shopping.com"? If so, don't use the "Skip skpTo" version of sendEMailNotification, use the "string sTo" version.

 

 

  • Louie

 

 

Hi Louie,

Thank you for your advice. Indeed, my module already has an attr-value(type text called emailAddress) containing the lists of Emails semi-colon separated: "John.Doe@TvRemote.com; Jane.Doe@Shopping.com". So, the created code is:

Module m = current
Object o
Skip my_list = createString()
for o in m do {
string inf="o.emailAddress"
put(my_list,inf,inf)
}
string sub_var="Module LLLL"
string msg_var="description of mail"
sendEMailNotification("DOORS",my_list,sub_var,msg_var)
delete(my_list)

Running this code, no error occurs, but the problem is that doesn't return anything.
Maybe you have a hint for me which will be high appreciated!!

Thank you,
Silvius

Re: Send emails using Skip lists
llandale - Tue Jun 01 17:05:11 EDT 2010

Silvius - Tue Jun 01 10:00:30 EDT 2010
Hi Louie,

Thank you for your advice. Indeed, my module already has an attr-value(type text called emailAddress) containing the lists of Emails semi-colon separated: "John.Doe@TvRemote.com; Jane.Doe@Shopping.com". So, the created code is:

Module m = current
Object o
Skip my_list = createString()
for o in m do {
string inf="o.emailAddress"
put(my_list,inf,inf)
}
string sub_var="Module LLLL"
string msg_var="description of mail"
sendEMailNotification("DOORS",my_list,sub_var,msg_var)
delete(my_list)

Running this code, no error occurs, but the problem is that doesn't return anything.
Maybe you have a hint for me which will be high appreciated!!

Thank you,
Silvius

I think your line #5 has a mis-placed quote:
string inf=o."emailAddress"

That might fix it.

So you have a module with several objects that have an attr-value of emails separated by semi-colons. It seems to me that you would EITHER use a single string "To" variable concatenating them together, OR use a Skip list separating them apart. I suppose what you seem to be doing might work: a skip list with semi-colon separated values.

  • Louie