Webservice sendMailing didn't work

Use this forum to report bugs and to check for bugfixes and new releases of OpenEMM

Moderator: moderator

Shuro
Posts: 20
Joined: Mon Oct 26, 2009 1:26 pm
Location: Germany, Pr. Oldendorf

Webservice sendMailing didn't work

Post 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!
Shuro
Posts: 20
Joined: Mon Oct 26, 2009 1:26 pm
Location: Germany, Pr. Oldendorf

Post 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 | 
+-----------+------------+--------------+------------+---------------------+------+-----------+---------------------+-----------+---------------------+
Shuro
Posts: 20
Joined: Mon Oct 26, 2009 1:26 pm
Location: Germany, Pr. Oldendorf

Post 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.
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Webservice sendMailing didn't work

Post 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 .
OpenEMM Maintainer
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Webservice sendMailing didn't work

Post 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.)
OpenEMM Maintainer
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Webservice sendMailing didn't work

Post by maschoff »

While we never got a feedback for our suggestion we will provide a revised WS method with release 2012 of OpenEMM.
OpenEMM Maintainer
Post Reply