× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Aaron,

Not exactly an answer to the question you have below (maybe more food for 
though) but when faced with a similar situation with different flavors of 
similar e-mails (these were all related to orders and invoices), here's what 
we've done:

Originally, I wrote an interface into Domino using the Hi-Test (I think -- it 
may be called something else) API's. We created documents in a "Notes database" 
and there was a routine that I wrote that ran periodically that actually sent 
it out. It worked pretty well but was very kludgy (but I had lots of fun 
building it!) and the interface into Domino was nasty. Also, the API's I was 
using have, I believe, gone away (or were rumored to be going away).

My second take on this was using e-mail templates and a customized version of 
SNDM. What I've done here is develop my own tag language for the templates and 
I wrote a program to parse them and build a source-physical file that SNDM uses 
to actually build and send the e-mail. The templates that I'm using are all 
loaded into arrays when the program initializes and each e-mail is sent after 
it's created. To determine which template is used, there's a control file that 
has basically an order number and a template id in it. The process is fairly 
fast (about 300 e-mails per minute on an 7 processor partition on our 840 but 
the time can vary all over the place depending upon how fast our mail server 
responds and if there are retries that need to happen). Dealing with the source 
physical file is very slow since it needs closed, cleared, and re-opened for 
each e-mail (writing a file in the IFS would likely be faster) and I'm sure I 
can find plenty of other ways to speed up the process, but since a minute or so 
on average isn't a big deal, I'm not going to mess with it. The absolute 
biggest advantage to this over the Domino solution is that the templates can be 
changed dramatically without needing to be a Domino programmer.

I've seen a how a few different packages handle dynamically generated e-mails 
and all of them appear to build and send each e-mail one at a time.

Matt
-----Original Message-----
From: Bartell, Aaron L. (TC) [mailto:ALBartell@taylorcorp.com]
Sent: Thursday, November 07, 2002 2:06 PM
To: 'rpg400-l@midrange.com'
Subject: Home grown descriptors in RPG/ILE


I am creating an RPG interface that will facilitate sending out emails.  In
creating this I realized that I may want to have more than one email being
created at one time in the same program, much like how you might have more
than one IFS file open in your program at any given time.

So now I am venturing into creating a descriptor of sorts so I can keep
track of different emails.  For instance it would look something like this:

D emlDescr1       s      10i 0
D emlDescr2       s      10i 0

/free
  emlDescr1 = newEmail()
    // emlDescr1 is equal to 0000000001
  emlDescr2 = newEmail()
    // emlDescr2 is equal to 0000000002

  addToAdr(emlDescr1:'me@yahoo.com')
  addToAdr(emlDescr2:'ITDept@helpdesk.com')

  error = sndEmail(emlDescr1)
  if error <> ' '
    sndEmail(emlDescr2)
  endif
/end-free

In the example above I would create two emails.  Each time the newEmail()
function was called I would increment a counter by 1 and send it back to the
calling program.  The way I was planning on storing them in my module was to
have an overlayed array called 'ToAdr' with the descriptor being the first
subfield so I could tell which addresses belonged to each email.  For
example:

     D                 DS                              inz
     D ToAdr                        266    dim(9999)
     D  Descr                        10i 0 overlay(ToAdr)
     D  Adr                         256    overlay(ToAdr:*next)

Has anybody ever done something similar to creating your own descriptors
before?  I am just trying to see if there is anything I should be watching
out for. . .

Aaron Bartell
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.