Page 1 of 1

SendMailing webservice api issue

Posted: Thu Oct 08, 2015 3:07 pm
by abinpaulr
Hi

I am having a small issue with sendmailing function in the webservice api.

After setting up a mailing by the following steps

step 1 createContentModule

step 2 saveContentModuleContent

create mailing
step 3 AddMailing (Here I am adding two texts for html and text version)

$data = array(
"mailingID" => $mailingid,
"blockName" => $htmlBlockName,
"targetID" => 0,
"content" => "This is html text content.",
"order" => 1
);
AddContentBlock($data)

$data = array(
"mailingID" => $mailingid,
"blockName" => $textBlockName,
"targetID" => 0,
"content" => 'This is text version of email.',
"order" => 2
);
AddContentBlock($data)



Step 4 addMailingBindings

Step 5 SendMailing

After Running SendMailing all the emails send out only contains text "This is html text content.".

But after step4 if I login to openemm admin area through "http://localhost:8080/" and try "send" button of mailing its always fine and correctly sends the html email from the template.

Anyone please help ? really stuck at this last step :(

Re: SendMailing webservice api issue

Posted: Fri Oct 09, 2015 2:59 pm
by maschoff
I do not understand
function ManageAdvertController>>actionCreate_advertmeta

Re: SendMailing webservice api issue

Posted: Sun Oct 11, 2015 5:29 pm
by abinpaulr
Hi

Sorry please neglect that that line, its from my code (php)

Thank You
Abin

Re: SendMailing webservice api issue

Posted: Mon Oct 12, 2015 8:02 am
by mdoerschmidt
Hi!

The problem in your client is, that you're mixing public and non-public webservice methods. createContentModule and saveContentModuleContent are part of the non-public API. Mailings created with public API (AddMailing) will not be able to use resources created with non-public API.

You have to use public API only. See webservice documentation.

Here is a generic workflow to create a new mailing and fill its content:
First, you have to create a new mailing by calling AddMailing. This webservice will return you the ID of the new mailing.
Use this mailing ID with AddContentBlock to fill the content of the mailing. AddMailing created content block "Text-Version" and "Html-Version" by default. (You can use ListContentBlockNames to list all available content block names for your mailing.)
After filling the mailing content, use SendMailing to deliver your mailing.


Best regards,

Markus