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 » Fri Nov 05, 2010 4:01 pm

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 » Mon Nov 08, 2010 9:35 am

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 » Mon Nov 08, 2010 10:19 am

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: 2177
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Webservice sendMailing didn't work

Post by maschoff » Sat Jan 22, 2011 9:46 pm

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: 2177
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Webservice sendMailing didn't work

Post by maschoff » Wed Mar 02, 2011 10:24 am

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: 2177
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Webservice sendMailing didn't work

Post by maschoff » Sun Feb 19, 2012 3:01 pm

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