Subscribe a User via DoubleOptIn over the Webservices?

Use this forum for topics related to OpenEMM contributions like the Typo3 extension or SugarCRM connector

Moderator: moderator

Subscribe a User via DoubleOptIn over the Webservices?

Postby oemmnewbie » Fri Jul 23, 2010 12:25 am

Hello Experts,

what is the suggested way to subscribe a new User to a list via "Double Opt In" via the WebServices?

Normally the List Subscription in OpenEMM is done via the forms. However I have to subscribe someone via a webservice call. It would be very kind to answer what I have to do.

The WebService Method that will Add a new User is:
addSubscriber

Thanks very much!
Jens
oemmnewbie
 
Posts: 3
Joined: Sat Jul 10, 2010 6:55 am

Postby Shuro » Fri Jul 23, 2010 8:52 am

Hello oemmnewbie, you could solve the "Double Opt In" with your code, in example PHP.

If the user has double opt in accepted, first you could check with "findSubscriber"-Webservice if the user-email exists in openemm.
Example:
Code: Select all
$o_soap_client->findSubscriber("webserviceuser", "webservicepass", "email", "user@email.com");

This returns the user-id or 0, on 0 you can create a new user and bindings, else you could add new bindings to exist user.
Shuro
 
Posts: 20
Joined: Mon Oct 26, 2009 1:26 pm
Location: Germany, Pr. Oldendorf

Postby oemmnewbie » Fri Jul 23, 2010 1:34 pm

Hello Shuro,

thanks a million times for your answer!

I am sorry, I had to realize my question was not formulated very well. Your answer absolutelyhelpfull as this would be the next problem I would have encountered, thats the way I will then use to bind a user a to mailing list.

My initial question was actually meant as "how can I add a user to openeem" so that the user is only added if he "douple opted-in".

I understand that the addSubscriber adds a Subscriber to the openemm database. This seems to be the same "process" as manually adding a user via the admin frontend to openemm. But by using this Webservices method (or by manually adding a User) it seems to be, that openemm assumes the user has already given his "consent/agreement" to receive emails. (so NO double opt in verification is triggered)

What I want to do is (via Webservices):

1. Add a new User Data to openemm (via Webservice)
2. Openemm then should send out the double opt in Email to the user

(This second step is the step I have not yet figured out how to trigger the "Opt in Email" when a user had been added via the Webservice "addSubscriber" method.)

Thank you very much and have a nice weekend!
Jens
oemmnewbie
 
Posts: 3
Joined: Sat Jul 10, 2010 6:55 am

Postby Shuro » Thu Jul 29, 2010 10:50 am

I think this is not possible... if you want to use web-services you must also do the double-opt-in outside of openemm.

As an example:

You have an form with html + php for register, you save the data in your database (not openemm) and send a mail with php to the user (confirm email), if he click the link, the web-services (both create and bind subscriber) will run with the data from your database and create the subscriber.

Sorry, there is no better solution...(i think so, no guarantee)

Good luck!
Shuro
 
Posts: 20
Joined: Mon Oct 26, 2009 1:26 pm
Location: Germany, Pr. Oldendorf

Re: Subscribe a User via DoubleOptIn over the Webservices?

Postby phil » Thu Jun 07, 2012 2:31 pm

Hi all,

You could create a new form 'doi_script' with:
Action: doi_user_register (en)
Success form content: true
Error form content: false

And run something like this:

<?php
$email = urlencode('test.test@test.com');
$firstname = urlencode('test');
$lastname = urlencode('test');
$return = file_get_contents('http://news.yourdomain.com/form.do?agnCI=1&agnFN=doi_script&agnSUBSCRIBE=1&agnMAILINGLIST=2&GENDER=2&MAILTYPE=1&FIRSTNAME='.$firstname.'&LASTNAME='.$lastname.'&EMAIL='.$email.'');
?>

Phil
phil
 
Posts: 9
Joined: Thu Jun 07, 2012 2:25 pm

Re: Subscribe a User via DoubleOptIn over the Webservices?

Postby pink » Mon Nov 17, 2014 7:43 am

Also, I'm implementing my own mail generator at the start of the process so that building emails is not expensive. Basically, I'm splitting on [agnXXX ...] tags and building a list of strings. Then, when I generate the email,I use StringBuilder to build the email and iterate through that list (rather than search) to build the emails through concatenation.
Join online CBAP dumps and Testking.net to pass pmp dumps exam in first bc Our best quality www.ku.edu and Hood College
pink
 
Posts: 1
Joined: Mon Nov 17, 2014 7:40 am


Return to OpenEMM Contributions

Who is online

Users browsing this forum: No registered users and 1 guest