Sending bulk emails

Doug Easterbrook doug at artsman.com
Mon Jun 20 17:33:38 UTC 2022


hi Martin.

It is more of a design philosophy/approach.

any copy of omnis can run the OW3 workers to send email, so the choice is which one.


Historically, I used to write code where we would
- do something, then
- create an email to send to the client.


the better approach that Xavier mentions (and we use) is to separate the processes of building email and sending it.

ie: on the workstation

- do something
- create email and SAVE to the database (with attachment link, email address, etc) with status like ’Not Done'


then, another omnis process (the server)
— polls the table for outstanding emails with status of ’Not done’
— puts a lock on the record so nobody else touches it
— uses the ow3 worker to send the email
— repeats the process after a period of time.

if an error occurs on an email, mark it as ‘error’ and save the error
if not error occurs, mark it ‘done'




we would tell the
— workstation to NOT run the omnis process and 
— omnis server to run the process

you can do that by testing a config file on startup (can I run emails?) , or perhaps check the platform (our linux processes do it), or what ever other marker you want to use to say who can/cannot send emails




you can have the server check if there are outstanding emails in a number of ways.

— you can use a timer process to wake up once in a while (say every 15 seconds) to check for a new ‘email’ record
— if using postgres, we use listen notify so that when an email reord is inserted, we trigger a notify — so that lets the server know right away
— a combination of both.
— some other method I’ve not thought of.




regarding:    do you mean to say the SMTP worker in the HUB is a workstation sample and not a server


the code is omnis code.  as mentioned, it can be in a omnis server, or a workstation, or both..     it is just omnis code.     we cause the server to do it on a timer, not in response to any http request. … but just if it notices a record there.




Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On Jun 20, 2022, at 9:58 AM, Martin Obongita <martin.obongita at yahoo.com> wrote:
> 
> Hi Doug,
> 
> How do you do that, sending emails through the server and not the workstation?
> 
> As in.. do you mean to say the SMTP worker in the HUB is a workstation sample and not a server?
> 
> What is the difference between coding in the server and workstation to send email... seeing that I'm developing on OS10.2 web version.
> 
> Rgds,
> Martin.
> 
> Sent from Yahoo Mail on Android <https://go.onelink.me/107872968?pid=InProduct&c=Global_Internal_YGrowth_AndroidEmailSig__AndroidUsers&af_wl=ym&af_sub1=Internal&af_sub2=Global_YGrowth&af_sub3=EmailSignature>
> On Mon, 20 Jun 2022 at 19:51, Doug Easterbrook via omnisdev-en
> <omnisdev-en at lists.omnis-dev.com> wrote:
> hi Xavier.
> 
> I just want to say I agree with using a server to send out all emails is better than each workstation doing its own.    
> 
> If the rationale is not obvious, the kind of things we’ve run into are
> 
> manage a database table with a queue of emails nakes it easier to track status and restart the emails if necessary
> 
> 
> workstations firewalls based on corporate policies are sometimes setup to block outgoing access (particularly if the default is deny for PCI compliance).. and if only the server can send emails, then its within the control of IT to open things up as necessary
> 
> its a worthwhile way to design the processes.
> 
> 
> 
> 
> 
> Doug Easterbrook
> Arts Management Systems Ltd.
> mailto:doug at artsman.com <mailto:doug at artsman.com>
> http://www.artsman.com <http://www.artsman.com/>
> Phone (403) 650-1978
> 
> > On Jun 20, 2022, at 7:23 AM, IT <it at plastipol.com <mailto:it at plastipol.com>> wrote:
> > 
> > Hi Martin,
> > 
> > You need SMTP OW3 worker not IMAP OW3  Worker.
> > 
> > I have modified the Omnis sample library as base for coding, so my omnis server is sending all my users emails. Users insert records with email data to be send and the server every minute sends all emails from all users. Makes retries, notify of error to users, etc. Better that every workstation sends his owns emails.
> > 
> > regards
> > 
> > xavier
> > 
> > 
> >> El 18 jun 2022, a las 18:57, Martin Obongita via omnisdev-en <omnisdev-en at lists.omnis-dev.com <mailto:omnisdev-en at lists.omnis-dev.com>> escribió:
> >> 
> >> Hi ALL,
> >> I am studying IMAP OW3 Worker Object in the HUB.How do I use the library to send bulk emails?For example, sending customer statements as attachments to their email addresses.
> >> 
> >> Kind regards,Martin Obongita.
> >> _____________________________________________________________
> >> Manage your list subscriptions at https://lists.omnis-dev.com <https://lists.omnis-dev.com/>
> >> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com <mailto:omnisdev-en at lists.omnis-dev.com> 
> > 
> > 
> > 
> > _____________________________________________________________
> > Manage your list subscriptions at https://lists.omnis-dev.com <https://lists.omnis-dev.com/>
> > Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com <mailto:omnisdev-en at lists.omnis-dev.com>
> 
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com <https://lists.omnis-dev.com/>
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com <mailto:omnisdev-en at lists.omnis-dev.com> 



More information about the omnisdev-en mailing list