The service enables you to register a new recipient using by mocking the web registraion form logic.
The text returned by the service is the text the recipient would have seen on his/her browser if they were to use the web registraion form produced by our system.
If the recipient should have been redirected to another url, the returned text will be the target url.
Java Code:
//get a reference to the service InwiseWebServices ws = new InwiseWebServices();
InwiseWebServicesSoap inwiseWebServicesSoap = ws.getInwiseWebServicesSoap();
//fill the security header
HeaderHandler hh = new HeaderHandler("myusername", "myPassword");
hh.setHeader(inwiseWebServicesSoap);
//fill the security header
HeaderHandler hh = new HeaderHandler("myusername", "myPassword");
hh.setHeader(inwiseWebServicesSoap);
//the new recipient email
String email = "email@email.com";
//wait for confirmation email from the recipient?
boolean doubleOptIn = false;
//send the new recipient a thank you email
boolean sendNewEmail = true;
//the body of the thank you email for a new recipient
String emailBodyToSendAfterNewRegistrationUrl = null;
//the text to display on the browser for a new recipient
String browserTextAfterNewRegistrationUrl = null;
//the body of the thank you email for an exisiting recipient
String emailBodyToSendAfterExistRegistrationUrl = null;
//the text to display on the browser for an existing recipient
String browserTextAfterExistRegistrationUrl = null;
//the text to display on the browser for an existing recipient
String charset = "utf-8";
//the thank you email subject for an existing recipient
String subjectForExising = null;
//the thank you email subject for a new recipient
String subjectForNew = null;
//if the email already exists, update the details?
boolean update = false;
//send email for an existing recipient
boolean sendExistingEmail = true;
//the custom fields values
inwise.ArrayOfCustomFieldValue fields = new ArrayOfCustomFieldValue();
fields.customFieldValue = new ArrayList<CustomFieldValue>();
CustomFieldValue field1 = new CustomFieldValue();
field1.setLocalName("field1");
field1.setFieldValue("my first name");
fields.customFieldValue.add(field1);
//the groups to subscribe to
inwise.ArrayOfAnyType groups = new ArrayOfAnyType();
groups.anyType = new ArrayList<Object>();
groups.anyType.add(34);
groups.anyType.add(158);
String result = inwiseWebServicesSoap.recipientsSignUpRecipient(email, doubleOptIn,
fields, groups, sendNewEmail, emailBodyToSendAfterNewRegistrationUrl,
browserTextAfterNewRegistrationUrl, emailBodyToSendAfterExistRegistrationUrl,
browserTextAfterExistRegistrationUrl, charset,
subjectForExising, subjectForNew, update, sendExistingEmail);
C# Code:
InwiseWebServices.InwiseWebServices ws = new InwiseWebServices.InwiseWebServices();
//fill the security header
InwiseWebServices.SecHeader header = new InwiseWebServices.SecHeader();
header.username = "myUsername";
header.pass = "myPassword";
ws.SecHeaderValue = header;//set credentials
//wait for confirmation email from the recipient?
bool doubleoptin = false;
//the new recipient email
string email = "email@email.com";
//the group to subscribe to
ArrayList groups =new ArrayList();
groups.Add(8152);
groups.Add(8823);
//send the new recipient a thank you email
bool sendNewEmail = false;
//the body of the thank you email for a new recipient
string emailBodyToSendAfterNewRegistrationUrl = null;
//the text to display on the browser for a new recipient
string browserTextAfterNewRegistrationUrl = null;
//the body of the thank you email for an exisiting recipient
string emailBodyToSendAfterExistRegistrationUrl = null;
//the text to display on the browser for an existing recipient
string browserTextAfterExistRegistrationUrl = null;
//the email charset
string charset = "utf-8";
//the thank you email subject for an existing recipient
string subjectForExising = null;
//the thank you email subject for a new recipient
string subjectForNew = null;
//if the email already exists, update the details?
bool update = true;
//send email for an existing recipient
bool sendExistingEmail = false;
//the custom fields values
InwiseWebServices.CustomFieldValue[] fields = null;
string browserTextOrRedirectUrl = ws.Recipients_SignUpRecipient(email, doubleoptin, fields, groups, sendNewEmail, emailBodyToSendAfterNewRegistrationUrl, browserTextAfterNewRegistrationUrl, emailBodyToSendAfterExistRegistrationUrl, browserTextAfterExistRegistrationUrl, charset, subjectForExising, subjectForNew, update, sendExistingEmail);
VB Code:
Dim ws As InwiseWebServices.InwiseWebServices = New InwiseWebServices.InwiseWebServices()
'fill the security header
Dim sec As InwiseWebServices.SecHeader = New InwiseWebServices.SecHeader()
sec.username = "username"
sec.pass = "myPassword"
ws.SecHeaderValue = sec 'set credentials
'wait for confirmation email from the recipient?
Dim doubleoptin As Boolean = False
'the new recipient email
Dim email As String = "email@email.com"
'the group to subscribe to
Dim groups As Object = New Object(2) {}
groups(0) = 8152
groups(1) = 8823
'send the new recipient a thank you email
Dim sendNewEmail As Boolean = False
'the body of the thank you email for a new recipient
Dim emailBodyToSendAfterNewRegistrationUrl As String = Nothing
'the text to display on the browser for a new recipient
Dim browserTextAfterNewRegistrationUrl As String = Nothing
'the body of the thank you email for an exisiting recipient
Dim emailBodyToSendAfterExistRegistrationUrl As String = Nothing
'the text to display on the browser for an existing recipient
Dim browserTextAfterExistRegistrationUrl As String = Nothing
'the email charset
Dim charset As String = "utf-8"
'the thank you email subject for an existing recipient
Dim subjectForExising As String = Nothing
'the thank you email subject for a new recipient
Dim subjectForNew As String = Nothing
'if the email already exists, update the details?
Dim update As Boolean = True
'send email for an existing recipient
Dim sendExistingEmail As Boolean = False
'the custom fields values
Dim fields() As InwiseWebServices.CustomFieldValue = Nothing
Dim browserTextOrRedirectUrl = ws.Recipients_SignUpRecipient(email, doubleoptin, fields, groups, sendNewEmail, emailBodyToSendAfterNewRegistrationUrl, browserTextAfterNewRegistrationUrl, emailBodyToSendAfterExistRegistrationUrl, browserTextAfterExistRegistrationUrl, charset, subjectForExising, subjectForNew, update, sendExistingEmail)