%%[
/* Get the Id of the account */
Set @mid = [memberid]
/* Get the key from the form */
Set @subKey = [_subscriberkey]
if Empty(@subKey) or @subKey == “” then
SET @subKey = “subkey@example.com”
endif
/* Create the subscriber’s object */
set @subscriber = CreateObject( “Subscriber” )
SetObjectProperty( @subscriber, “EmailAddress”, @subKey )
SetObjectProperty( @subscriber, “SubscriberKey”, @subKey )
/* make sure the system is posting */
SET @isUpdate = RequestParameter(“personal”)
SET @save = “FALSE”
if Not Empty(@isUpdate) then
SET @save = “TRUE”
/* get the attributes and checkBoxes */
SET @checkBoxes = RequestParameter(“checkBoxList”)
SET @attributes = RequestParameter(“attributes”)
/* Create arrays from each of the lists */
SET @checkArray = BuildRowSetFromString(@checkBoxes,”||”)
SET @attArray = BuildRowSetFromString(@attributes,”||”)
SET @attCount = RowCount(@attArray)
SET @checkCount = RowCount(@checkArray)
SET @display = “”
SET @display2 = “”
if @attCount > 0 then
/* iterate all of the elements */
FOR @i = 1 TO @attCount DO
Set @attribute = Field(Row(@attArray, @i),1)
Set @value = RequestParameter(@attribute)
/* Create the Attribute */
Set @att = CreateObject( “Attribute” )
SetObjectProperty( @att, “Name”, @attribute )
SetObjectProperty( @att, “Value”, @value )
/* Set the attribute to the subscriber */
AddObjectArrayItem( @subscriber, “Attributes”, @att )
/*
Set @display = Concat(@display,@attribute, ” = ” , @value, ” @@@ “)
*/
NEXT @i
endif
/*
Set @display = Concat(@display,” —CHECK — “)
*/
if @checkCount > 0 then
/* iterate all of the elements */
FOR @i = 1 TO @checkCount DO
set @values = “”
Set @attribute = Field(Row(@checkArray, @i),1)
Set @internalCheckArray = BuildRowSetFromString(@attribute,”:”)
if RowCount(@internalCheckArray) > 1 then
SET @checkName = Field(Row(@internalCheckArray, 1),1)
SET @checkNumber = Field(Row(@internalCheckArray, 2),1)
FOR @j = @checkNumber DOWNTO 1 DO
Set @singleCheckName = Concat(@checkName,@j)
Set @value = RequestParameter(@singleCheckName)
IF not Empty(@value) then
if(Empty(@values))then
set @values = @value
else
set @values = Concat(@values, “,”, @value )
endif
endif
NEXT @j
/* Create the Attribute */
Set @apiName = Replace(@checkName,”-“,” “)
Set @att = CreateObject( “Attribute” )
SetObjectProperty( @att, “Name”, @apiName )
SetObjectProperty( @att, “Value”, @values )
/* Set the attribute to the subscriber */
AddObjectArrayItem( @subscriber, “Attributes”, @att )
/*
Set @display = Concat(@display,@apiName, ” = ” , @values, ” @@@ “)
*/
endif
NEXT @i
endif
endif
/* Did the user pressed the subscriptions submit button */
if RequestParameter(“subscription”) == 1 then
SET @save = “TRUE”
/* request paramter from List A */
Set @theListA = RequestParameter(“ListsA”)
Set @array = BuildRowSetFromString(@theListA, ‘|’)
for @r = 1 to Rowcount(@array) do
Set @configRow = Row(@array,@r)
Set @configkey = Field(@configRow,1)
Set @value = RequestParameter(@configkey)
if Empty(@value) then
set @subscription = CreateObject(“SubscriberList”)
SetObjectProperty( @subscription, “ID”, @configkey )
SetObjectProperty( @subscription, “IDSpecified”, “true” )
SetObjectProperty( @subscription, “Status”, “Unsubscribed” )
SetObjectProperty( @subscription, “StatusSpecified”, “true” )
AddObjectArrayItem( @subscriber, “Lists”, @subscription )
else
set @subscription = CreateObject(“SubscriberList”)
SetObjectProperty( @subscription, “ID”, @configkey )
SetObjectProperty( @subscription, “IDSpecified”, “true” )
SetObjectProperty( @subscription, “Status”, “Active” )
SetObjectProperty( @subscription, “StatusSpecified”, “true” )
AddObjectArrayItem( @subscriber, “Lists”, @subscription )
endif
next @r
/* request paramter from List U */
Set @theListU = RequestParameter(“ListsU”)
Set @array = BuildRowSetFromString(@theListU, ‘|’)
for @r = 1 to Rowcount(@array) do
Set @configRow = Row(@array,@r)
Set @configkey = Field(@configRow,1)
Set @value = RequestParameter(@configkey)
if @value == “Active” then
set @subscription = CreateObject(“SubscriberList”)
SetObjectProperty( @subscription, “ID”, @configkey )
SetObjectProperty( @subscription, “IDSpecified”, “true” )
SetObjectProperty( @subscription, “Status”, “Active” )
SetObjectProperty( @subscription, “Action”, “create” )
AddObjectArrayItem( @subscriber, “Lists”, @subscription )
endif
next @r
endif
/* Did the user pressed the unsub all submit button */
if RequestParameter(“subscriptionALL”) == 1 then
SET @save = “TRUE”
if RequestParameter(“UnsubAll”) == “true” then
SetObjectProperty( @subscriber, “Status”, “Unsubscribed” )
else
SET @error = “True”
set @message = “Please Select One of the Options”
endif
endif
/* SET @display3 = “” */
/* Did the user change their preferernces */
if RequestParameter(“preference”) == 1 then
SET @save = “TRUE”
Set @ppr = RequestParameter(“preferences”)
Set @array = BuildRowSetFromString(@ppr, ‘|’)
/* SET @display3 = Concat(@array,”@@@@@@@@@”) */
for @r = 1 to Rowcount(@array) do
Set @configRow = Row(@array,@r)
Set @configkey = Field(@configRow,1)
Set @value = RequestParameter(@configkey)
if @configKey == “EmailTypePreference” then
if @value == “true” then
SetObjectProperty( @subscriber, “EmailTypePreference”, “HTML” )
else
SetObjectProperty( @subscriber, “EmailTypePreference”, “TEXT” )
endif
else
if @value == “true” then
Set @value = “True”
else
Set @value = “False”
endif
set @pref = CreateObject( “Attribute” )
SetObjectProperty( @pref, “Name”, @configkey )
SetObjectProperty( @pref, “Value”, @value )
AddObjectArrayItem( @subscriber, “Attributes”, @pref )
endIf
next @r
endif
IF @save == “TRUE” then
/* change the last modify date */
SET @theTime = Format(Now(), “MM/dd/yyyy”)
set @LastModify = CreateObject( “Attribute” )
SetObjectProperty( @LastModify, “Name”, “Last Modify” )
SetObjectProperty( @LastModify, “Value”, @theTime )
AddObjectArrayItem( @subscriber, “Attributes”, @LastModify )
/* Update the Subscriber If we have to */
var @createOpts, @saveOpt
/* Create the save option */
set @saveOpt = CreateObject(“SaveOption”)
SetObjectProperty( @saveOpt, “SaveAction”, “UpdateAdd” )
SetObjectProperty( @saveOpt, “PropertyName”, “*” )
/* Specify the Update option */
set @createOpts = CreateObject(“CreateOptions”)
AddObjectArrayItem( @createOpts, “SaveOptions”, @saveOpt )
/* Update the subscriber */
set @createStatusCode = InvokeCreate( @subscriber, @createErrDesc, @createErrNo, @createOpts )
/* If we failed to create the subscriber, output the information as the top level error */
if @createStatusCode != “OK” then
Redirect(“http://%%microsite_base_url[default]3891541[/default]%%”)
else
SET @TheWorks = ‘true’
endif
endif
]%%
Profile Center
Welcome to the Subscriber Profile Center! You may use this page at any time to update the information you have provided to us.
On this Page
My Personal Information
Update your personal information here. Once you have made changes, click the Update button in this section.
* Indicates a Required Field
*Some of your selections had errors. Please fix them and click Update.
*Thank you for updating your profile!
%%[
endif
endif
/*
If the Groups are different and there is a group name (aka NO Text related fields)
*/
if @group != @group2 and NOT Empty(@groupName) then
/*
If there is no fields or the limit is not 0, we are going to create
a dynamic call to a javascript function to make sure the limits are met.
*/
if Not Empty(@limit) and @limit !=0 then
Set @call = Concat(@cleanGroup,”,”, @limit)
if not Empty(@tocall) then
Set @tocall = Concat(@tocall,”|” , @call)
else
Set @tocall = @call
endif
endif
/*
If the type is a drop-down or a Radio we need to save all the names
in the list by just concatinating them with a comma
*/
if @dt == “Radio” OR @dt == “Drop Down” then
if @readOnly != true then
Set @AttributeList = Concat(@AttributeList,”||”,@name)
endif
/*
If the type is a check box we need to concatenate them with a pipe
So we can then append all the values and save them in ONE field
*/
endif
/*
Set the counter to 0 and then the counter of the columns to the number
Of colums that we need to display. When these two numbers are the same
we need to diplay the elements in the next page
*/
Set @counter = 0
Set @columnNum = @column
/*
ID used to display an error when the user selects too many options,
or a required field is not filled. The option is always in the
page, but hidden. It is dynamic because we only need the
group name and the rest is just appended
*/
Set @theErrorID = Concat(@cleanGroup,”error”)
Set @requiredID = Concat(@cleanGroup,”required”)
/*
Div that solved the problems related to the floating Divs
*/
]%%
%%[
/*
IF the previous element was not a input field or a drop-down
we are going to display a break before the group header
*/
if @dt2 != “Input Field” and @dt2 != “Drop Down” then
]%%
%%[
endif
]%%
%%[
/* If the element is required display the red * */
if @required == true then
Set @requiredFields = Concat(@requiredFields,”|”,@cleanID)
]%%
*
%%[
else
]%%
%%[
endif
/*
Display the group header and the error code for too many selections
*/
]%%
%%=v(@groupName)=%% Too many selections (MAX %%=v(@limit)=%%)
%%[
/*
If the element is required then set a hidden message that we can show when there is an error.
*/
if @required == true then
]%%
This Field is required
%%[
else
]%%
%%[
endif
/*
If the element is not a drop-down, we need to create a space between the header and the field
*/
if @dt != “Drop Down” then
]%%
%%[
endif
if @dt == “CheckBox” then
]%%
%%[
endif
else
Set @counter = Add(@counter, 1)
Set @theTest = Concat(@theTest, ” ” , @ev)
endif
/*
If the groups are different and the names are also different
That means that we have change the element
*/
if @group != @group2 and @name != @name2 then
/* if the data type is a dropDown we need to open the drop
Down Tag
*/
if @dt == “Drop Down” then
]%%