SendMailing webservice api issue

Use this forum for all questions related to the source code of OpenEMM

Moderator: moderator

SendMailing webservice api issue

Postby abinpaulr » Thu Oct 08, 2015 3:07 pm

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 :(
Last edited by abinpaulr on Sun Oct 11, 2015 5:27 pm, edited 1 time in total.
abinpaulr
 
Posts: 16
Joined: Fri May 29, 2015 6:49 am

Re: SendMailing webservice api issue

Postby maschoff » Fri Oct 09, 2015 2:59 pm

I do not understand
function ManageAdvertController>>actionCreate_advertmeta
OpenEMM Maintainer
maschoff
Site Admin
 
Posts: 2129
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany

Re: SendMailing webservice api issue

Postby abinpaulr » Sun Oct 11, 2015 5:29 pm

Hi

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

Thank You
Abin
abinpaulr
 
Posts: 16
Joined: Fri May 29, 2015 6:49 am

Re: SendMailing webservice api issue

Postby mdoerschmidt » Mon Oct 12, 2015 8:02 am

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
mdoerschmidt
 
Posts: 18
Joined: Fri Jan 04, 2013 8:55 am


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest