Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In case the customer's portal has its own subscription forms, linked to other databases (e.g. to register to a database, to access a restricted area, for user authentication…) it is possible to add to the page code the following code, which allows to simultaneously record the data also within the MailUp console, with or without confirmation request.


Required calls to subscribe a user

To subscribe a user, a call - POST or GET - has to be performed to the address http://newsletter.domainname.tld/frontend/xmlSubscribe.aspx, passing the following parameters in random order:

List : list ID* (Mandatory)
Group : Id of the group in which to insert the user* (Optional)
Email : recipient's email address (Mandatory)
Confirm : boolean value which specifies whether to subscribe the user at once (0) or send a confirmation request (1) (optional – default : 1)
csvFldNames : code list of the personal data fields to be updated, separated by the ";" character* (optional)
csvFldValues : values linked to the personal data fields to be updated, separated by the ";" character and provided in the same order as the fields specified in the parameter "csvFldNames" (Optional)

*Code list is available at the page Settings > Codes table in the administration console. 

Example

I You may want to subscribe the user John Smith to a "General list" in group 1 without asking for a conformation, and to list 2 sending a confirmation request:


name : John Smith
e-mail : smith@myprovider.com 
company : MyCompany Inc.
gender: M


To subscribe the user to these two lists, two different calls have to be performed (On In this case the GET method is more convenient, as it calls the page directly, using the proper querystrings).
The necessary codes I need are displayed in the codes table: 1 for "General list", 8 for "List 2", 6 for group 1 in the general list. The codes for personal data fields are: Field1, Field2, Field3, Field5 (Name, Surname, Company, Gender). So the calls will have to be structured like this:

http://newsletter.domainname.tld/frontend/xmlSubscribe.aspx?list=1&group=6&email=smith@myprovider.com&confirm=false&csvFldNames=field1;field2;field3;field5&csvFldValues=John;Smith;MyCompany Inc;M
http://newsletter.domainname.tld/frontend/xmlSubscribe.aspx?list=8&email=smith@myprovider.com&confirm=true&csvFldNames=field1;field2;field3;field5&csvFldValues=John;Smith;MyCompany Inc.;M

In the second case a confirmation email will be created, freely customizable at the page Settings > Confirmation request. Choose the appropriate list at the page Settings > Codes table in the administration console.
If the user clicks in the subscription link provided in the confirmation email he will be subscribersubscribed, otherwise he will remain among "Pending" users.


Page xmlSubscribe.aspx returns the following values:

0 : Subscription completed

1 : Generic error

2 : Invalid address

3 : User already subscribed

-1011: IP not registered

These values can be used in subscription procedures to differentiate the possible outcomes of the operation
   

...