Page 1 of 1

Webservice sendMailing didn't work

Posted: Fri Nov 05, 2010 4:01 pm
by Shuro
OpenEMM Version 6.1
System: Debian Lenny

Webservice didn't send admin, test and world mailings out, don't know why, Webservice returns 1, so it should be okay, but no mails will generated. Also the mailing isn't marked as send in OpenEMM backend. Also there is no entry in mailing_account_tbl for the mailing


Edit: Other Webservices work!

Posted: Mon Nov 08, 2010 9:35 am
by Shuro
Addition:

an extract from the maildrop_status_tbl Table, other mailings have genstatus = 3.

Code: Select all

root@localhost (openemm)>select * from maildrop_status_tbl WHERE mailing_id=106;
+-----------+------------+--------------+------------+---------------------+------+-----------+---------------------+-----------+---------------------+
| status_id | company_id | status_field | mailing_id | senddate            | step | blocksize | gendate             | genstatus | genchange           |
+-----------+------------+--------------+------------+---------------------+------+-----------+---------------------+-----------+---------------------+
|       145 |          1 | T            |        106 | 2010-11-08 09:15:03 |    0 |         0 | 2010-11-08 09:14:04 |         0 | 2010-11-08 09:14:04 | 
|       146 |          1 | T            |        106 | 2010-11-08 09:21:07 |    0 |         0 | 2010-11-08 09:20:07 |         0 | 2010-11-08 09:20:07 | 
|       147 |          1 | T            |        106 | 2010-11-08 09:21:08 |    0 |         0 | 2010-11-08 09:20:08 |         0 | 2010-11-08 09:20:08 | 
|       148 |          1 | T            |        106 | 2010-11-08 09:21:09 |    0 |         0 | 2010-11-08 09:20:09 |         0 | 2010-11-08 09:20:09 | 
|       149 |          1 | T            |        106 | 2010-11-08 09:29:49 |    0 |         0 | 2010-11-08 09:28:49 |         0 | 2010-11-08 09:28:49 | 
|       150 |          1 | T            |        106 | 2010-11-08 09:30:01 |    0 |         0 | 2010-11-08 09:29:02 |         0 | 2010-11-08 09:29:02 | 
+-----------+------------+--------------+------------+---------------------+------+-----------+---------------------+-----------+---------------------+

Posted: Mon Nov 08, 2010 10:19 am
by Shuro
Okay, i looked in the source code and found a workaround by myself:

That's the code i used to send my request.

Code: Select all

sendMailing("username", "password", 106, "T", $i_send_timestamp, 0, 0);
The timestamp is the current timestamp + 60 sec.

In the source-code from OpenEMM are follow lines:

EmmWebservice.java - Line: 396 - 411

Code: Select all

if(sendTime != 0) {
                aCal.setTime(new java.util.Date(((long) sendTime) * 1000L));
                drop.setGenStatus(0);
            } else {
                drop.setGenStatus(1);
            }
            drop.setSendDate(aCal.getTime());

            aMailing.getMaildropStatus().add(drop);
            dao.saveMailing(aMailing);
            if(drop.getGenStatus() == 1
                   && drop.getStatus() != MaildropEntry.STATUS_ACTIONBASED
                   && drop.getStatus() != MaildropEntry.STATUS_DATEBASED) {
                aMailing.triggerMailing(drop.getId(), new Hashtable(), con);
            }
            returnValue = 1;
It seems that the webservice only trigger a mail if GenStatus = 1, which is only given when the timestamp is 0.

So my workaround is using timestamp = 0, but it is only an workaround, no solution.

Please fix it.

Re: Webservice sendMailing didn't work

Posted: Sat Jan 22, 2011 9:46 pm
by maschoff
I could reproduce the described behaviour. It is a bug, we will take care of it and announce the availability of a bugfix via Twitter at http://twitter.com/openemm .

Re: Webservice sendMailing didn't work

Posted: Wed Mar 02, 2011 10:24 am
by maschoff
Please try this code instead:

Code: Select all

if(sendTime != 0) {
                aCal.setTime(new java.util.Date(((long) sendTime) * 1000L));
                drop.setGenStatus(0);
            }
            drop.setSendDate(aCal.getTime());

            aMailing.getMaildropStatus().add(drop);
            dao.saveMailing(aMailing);
            if(drop.getGenStatus() == 1
                   && drop.getStatus() != MaildropEntry.STATUS_ACTIONBASED
                   && drop.getStatus() != MaildropEntry.STATUS_DATEBASED) {
(else clause removed which sets GenStatus to 1).

Does it work now? (BTW, admin and test mails are always sent immediately.)

Re: Webservice sendMailing didn't work

Posted: Sun Feb 19, 2012 3:01 pm
by maschoff
While we never got a feedback for our suggestion we will provide a revised WS method with release 2012 of OpenEMM.