Page 1 of 1

WebService method newEmailMailing does not work as specified

Posted: Tue Feb 03, 2009 10:51 pm
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

Posted: Fri Aug 14, 2009 3:35 pm
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 ... :-)