WebService method newEmailMailing does not work as specified

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

Moderator: moderator

mkalen
Posts: 33
Joined: Tue Jan 20, 2009 7:51 pm

WebService method newEmailMailing does not work as specified

Post by mkalen »

Regarding ID 2549858 in the SourceForge bugtracker, there is a second difference between the documentation and actual function. Documentation states:
The values for mailinglistID, targetID and emailSender will be taken from the template in case you set them to 0 and "" (empty string for emailSender) respectively.
As reported in 2549858 the code does not do this for emailSender. Today I found out that it also does not follow the documented behavior for the mailinglistID parameter. mailinglistID is always taken from the template if a template is used, even if the SOAP-parameter is != 0.

I think there is fault in the code. I propose the following change in EmmWebservice#newEmailMailing from:

Code: Select all

        if(aMailing.getMailTemplateID() == 0 && mailinglistID != 0) {
        	aMailing.setMailinglistID(mailinglistID);
        }
("if no template used and mailinglist id is set in SOAP-call then set new mailinglist ID to SOAP parameter")
to:

Code: Select all

        if(aMailing.getMailTemplateID() == 0 || mailinglistID != 0) {
        	aMailing.setMailinglistID(mailinglistID);
        }
("if no template used OR mailinglist id is set in SOAP-call then set new mailinglist ID to SOAP parameter")

That way the new mailing will have it's mailinglist ID set from the SOAP parameter according to the documentation.

My use-case: I am trying to create a number of new mailings from a template via SOAP. The resulting mailings should not always be tied to the same mailinglist as the template.

What do you think?
Regards,
Martin
maschoff
Site Admin
Posts: 2596
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Post by maschoff »

Yes, you are right, I will put it in OpenEMM 6. However, what shouldn't happen is no templateID and no mailinglistID. This could cause problems later ... :-)
OpenEMM Maintainer
Post Reply