Page 1 of 1

Subscribe a User via DoubleOptIn over the Webservices?

Posted: Fri Jul 23, 2010 12:25 am
by oemmnewbie
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

Posted: Fri Jul 23, 2010 8:52 am
by Shuro
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.

Posted: Fri Jul 23, 2010 1:34 pm
by oemmnewbie
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

Posted: Thu Jul 29, 2010 10:50 am
by Shuro
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!

Re: Subscribe a User via DoubleOptIn over the Webservices?

Posted: Thu Jun 07, 2012 2:31 pm
by phil
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?agnC ... L='.$email.'');
?>

Phil

Re: Subscribe a User via DoubleOptIn over the Webservices?

Posted: Mon Nov 17, 2014 7:43 am
by pink
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.