ADDING AND RETRIEVING SUBSCRIBER TO LIST

E-Mail SignUp Form

%%[
VAR @email
SET @email=requestparameter(“Email Address”)

SET @rr2 = CreateObject(“RetrieveRequest”)
SetObjectProperty(@rr2,”ObjectType”,”Subscriber”)
AddObjectArrayItem(@rr2, “Properties”, “ID”)

/* We set the filter to retrieve only the subscriber for whom the email address has been provided */
SET @sfp2 = CreateObject(“SimpleFilterPart”)
SetObjectProperty(@sfp2,”Property”,”EmailAddress”)
SetObjectProperty(@sfp2,”SimpleOperator”,”equals”)
AddObjectArrayItem(@sfp2,”Value”,@email)

SetObjectProperty(@rr2,”Filter”,@sfp2)
SET @atts = InvokeRetrieve(@rr2,@status)

IF RowCount(@atts) > 0 THEN
/* We must loop over the retrieved attributes and store each needed value in a variable */
SET @subAtts = Field(Row(@atts,1),”Attributes”)
FOR @c = RowCount(@subAtts) DOWNTO 1 DO
SET @att = Row(@subAtts,@c)
SET @att_name = Field(@att,’Name’)
SET @att_val = Field(@att,’Value’)

IF @att_name == “Salutation” THEN
SET @att_sal = @att_val
ELSEIF @att_name == “Firstname” THEN
SET @att_first = @att_val
ELSEIF @att_name == “Lastname” THEN
SET @att_last = @att_val
ELSEIF @att_name == “Company” THEN
SET @att_comp = @att_val
ELSEIF @att_name == “Position” THEN
SET @att_level = @att_val
ELSEIF @att_name == “Jobfunction” THEN
SET @att_job = @att_val
ELSEIF @att_name == “Industry” THEN
SET @att_industry = @att_val
ELSEIF @att_name == “Country” THEN
SET @att_country = @att_val

ENDIF

/* We now have all the information we need to pre-populate, let’s put it in the HTML below */
NEXT @c
ENDIF

SET @retrieveRequest = CreateObject(“RetrieveRequest”)
SetObjectProperty(@retrieveRequest, “ObjectType”, “ListSubscriber”)

SET @simpleFilterPart = CreateObject(“SimpleFilterPart”)
SetObjectProperty(@simpleFilterPart, “Property”, “SubscriberKey”)
SetObjectProperty(@simpleFilterPart, “SimpleOperator”, “equals”)
AddObjectArrayItem(@simpleFilterPart, “Value”, @email)

AddObjectArrayItem(@retrieveRequest,”Properties”,”ListID”)
AddObjectArrayItem(@retrieveRequest,”Properties”,”Status”)

SetObjectProperty(@retrieveRequest, “Filter”, @simpleFilterPart)
SET @ls = InvokeRetrieve(@retrieveRequest,@status,@reqID)
IF RowCount(@ls) > 0 THEN
FOR @i = 1 TO RowCount(@ls) DO

SET @row = Row(@ls,@i)
SET @listid = Field(@row,”ListID”)
SET @status = Field(@row,”Status”)

/* We only want to check boxes when the subscriber is Active on the list ,XXXX pass list ID */
IF @status == “Active” THEN
IF @listid == “XXXX” THEN
SET @booz_fs = “true”
ENDIF
IF @listid == “XXXX” THEN
SET @booz_alumma = “true”
ENDIF
IF @listid == “XXXX” THEN
SET @it_fs = “true”
ENDIF
IF @listid == “XXXX” THEN
SET @cmt_fs = “true”
ENDIF
IF @listid == “XXXX” THEN
SET @kat_center = “true”
ENDIF
IF @listid == “XXXX” THEN
SET @cr_fs = “true”
ENDIF
IF @listid == “XXXX” THEN
SET @st_business = “true”
ENDIF
IF @listid == “XXXX” THEN
SET @fs_fs = “true”
ENDIF
ENDIF
NEXT @i
ENDIF

]%%

<form name=”SignUp” method=”post” action=”http://pages.s4.exacttarget.com/page.aspx?QS=c76003443ff9837d0c1bcd23aef888ec6a789f73ad887667″>

booz&Co.


E-mail Sign-Up Form

Personal Information:

Salutation:

–Select One Value–
Mr
Mrs

First Name:
Last Name:
E-mail:
Company/Organization:
Level/Positon:

–Select One Value–

Level1

Level2

Level3

Job Function:

–Select One Value–
Team Leader
Trainee
Trainer
Software Engineer

Industry:

–Select One Value–
BPO
IT
KPO
Software

Country:

–Select One Value–

China
US
UK
India

Are you a Booz & Company alumna/alumnus?  Yes

Online Publications:
Booz Foresight

A selection of the best most proacative and timley work from booz & company

IT Foresight

Booz & company’s prespective on how Information Technology can create essential advantage for you
CMT Foresight

Booz & Company’s perspective on how communication Media& Technology can create essential advantage for your company
Katzenbach Center

The Katzenbach center at Booz & company focuses on the devlopment and application of innovative Ideas in the areas of Leadership. Organisation & Culture
C&R Foresight

Best & Company’s perspective on how to create essential advantage in the consumer product and retail industry
strategy+business enews

Powerful, quick and vital business analysis. insights commentary and other ideas direct from s+b, Booz & Company’s quaterly production.
FS Foresight

Booz & Company’s recent thinking on how to create essential advantage in the financial service industry

UPDATING TO LIST
%%[
/* retrieve List attribute Values*/
SET @email = RequestParameter(“EmailAddress”)
SET @salutation = RequestParameter(“Salutation”)
SET @first_name = RequestParameter(“FirstName”)
SET @last_name = RequestParameter(“LastName”)
SET @company = RequestParameter(“company”)
SET @Position = RequestParameter(“Position”)
SET @Jobfunction = RequestParameter(“Jobfunction”)
SET @Industry = RequestParameter(“Industry”)
SET @Country = RequestParameter(“Country”)

/* retrieve List Values*/
SET @booz_alumma = RequestParameter(“boozalumna”)
SET @booz_fs = RequestParameter(“boozforesight”)
SET @it_fs = RequestParameter(“itforesight”)
SET @cmt_fs = RequestParameter(“cmtforesight”)
SET @kat_center = RequestParameter(“katzenbachcenter”)
SET @cr_fs = RequestParameter(“crforesight”)
SET @st_business = RequestParameter(“strategybusiness”)
SET @fs_fs = RequestParameter(“fsforesight”)

/* We must keep retreiving querystring parameters for each value passed over from the front end */

SET @sub = CreateObject(“Subscriber”)
SetObjectProperty(@sub,”EmailAddress”, @email)
SetObjectProperty(@sub,”SubscriberKey”, @email)

Set @Attrib = CreateObject(“Attribute”)
SetObjectProperty(@Attrib,”Name”,”Salutation”)
SetObjectProperty(@Attrib,”Value”, @salutation)
AddObjectArrayItem(@sub,”Attributes”, @Attrib)

Set @Attrib = CreateObject(“Attribute”)
SetObjectProperty(@Attrib,”Name”,”Firstname”)
SetObjectProperty(@Attrib,”Value”, @first_name)
AddObjectArrayItem(@sub,”Attributes”, @Attrib)

Set @Attrib = CreateObject(“Attribute”)
SetObjectProperty(@Attrib,”Name”,”Lastname”)
SetObjectProperty(@Attrib,”Value”, @last_name)
AddObjectArrayItem(@sub,”Attributes”, @Attrib)

Set @Attrib = CreateObject(“Attribute”)
SetObjectProperty(@Attrib,”Name”,”Company”)
SetObjectProperty(@Attrib,”Value”, @company)
AddObjectArrayItem(@sub,”Attributes”, @Attrib)

Set @Attrib = CreateObject(“Attribute”)
SetObjectProperty(@Attrib,”Name”,”Jobfunction”)
SetObjectProperty(@Attrib,”Value”, @Jobfunction)
AddObjectArrayItem(@sub,”Attributes”, @Attrib)

Set @Attrib = CreateObject(“Attribute”)
SetObjectProperty(@Attrib,”Name”,”Industry”)
SetObjectProperty(@Attrib,”Value”, @Industry)
AddObjectArrayItem(@sub,”Attributes”, @Attrib)

Set @Attrib = CreateObject(“Attribute”)
SetObjectProperty(@Attrib,”Name”,”Position”)
SetObjectProperty(@Attrib,”Value”, @Position)
AddObjectArrayItem(@sub,”Attributes”, @Attrib)

Set @Attrib = CreateObject(“Attribute”)
SetObjectProperty(@Attrib,”Name”,”Country”)
SetObjectProperty(@Attrib,”Value”, @Country)
AddObjectArrayItem(@sub,”Attributes”, @Attrib)

/* Keep repeating the above , one for each list attribute */
/* One Attribute object for each RequestParameter above. These values need to match the account Attributes names exactly. */

IF @booz_alumma == “on” THEN
Set @List = CreateObject(“SubscriberList”)
]%%

This is my list %%=v(@List)=%%

%%[
SetObjectProperty(@List,”ID”,”4020″) /* List ID of Booz Alumna/Alumnus */
SetObjectProperty(@List,”Status”,”Active”)
AddObjectArrayItem(@sub,”Lists”, @List)
ELSE
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”4020″) /* List ID of Booz Alumna/Alumnus */
SetObjectProperty(@List,”Status”,”Unsubscribed”)
AddObjectArrayItem(@sub,”Lists”, @List)
ENDIF

IF @booz_fs == “on” THEN
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3969″) /* List ID of Booz Foresight */
SetObjectProperty(@List,”Status”,”Active”)
AddObjectArrayItem(@sub,”Lists”, @List)
ELSE
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3969″) /* List ID of Booz Foresight */
SetObjectProperty(@List,”Status”,”Unsubscribed”)
AddObjectArrayItem(@sub,”Lists”, @List)
ENDIF

IF @it_fs == “on” THEN
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3973″) /* List ID of IT Foresight */
SetObjectProperty(@List,”Status”,”Active”)
AddObjectArrayItem(@sub,”Lists”, @List)
ELSE
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3973″) /* List ID of IT Foresight */
SetObjectProperty(@List,”Status”,”Unsubscribed”)
AddObjectArrayItem(@sub,”Lists”, @List)
ENDIF

IF @cmt_fs == “on” THEN
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3970″) /* List ID of CMT Foresight */
SetObjectProperty(@List,”Status”,”Active”)
AddObjectArrayItem(@sub,”Lists”, @List)
ELSE
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3970″) /* List ID of CMT Foresight */
SetObjectProperty(@List,”Status”,”Unsubscribed”)
AddObjectArrayItem(@sub,”Lists”, @List)
ENDIF

IF @kat_center == “on” THEN
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3974″) /* List ID of KatzenbachCenter */
SetObjectProperty(@List,”Status”,”Active”)
AddObjectArrayItem(@sub,”Lists”, @List)
ELSE
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3974″) /* List ID of KatzenbachCenter */
SetObjectProperty(@List,”Status”,”Unsubscribed”)
AddObjectArrayItem(@sub,”Lists”, @List)
ENDIF

IF @cr_fs == “on” THEN
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3971″) /* List ID of CR Foresight */
SetObjectProperty(@List,”Status”,”Active”)
AddObjectArrayItem(@sub,”Lists”, @List)
ELSE
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3971″) /* List ID of CR Foresight */
SetObjectProperty(@List,”Status”,”Unsubscribed”)
AddObjectArrayItem(@sub,”Lists”, @List)
ENDIF

IF @st_business == “on” THEN
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3975″) /* List ID of Strategy Business */
SetObjectProperty(@List,”Status”,”Active”)
AddObjectArrayItem(@sub,”Lists”, @List)
ELSE
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3975″) /* List ID of Strategy Business */
SetObjectProperty(@List,”Status”,”Unsubscribed”)
AddObjectArrayItem(@sub,”Lists”, @List)
ENDIF

IF @fs_fs == “on” THEN
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3972″) /* List ID of FS Foresight */
SetObjectProperty(@List,”Status”,”Active”)
AddObjectArrayItem(@sub,”Lists”, @List)
ELSE
Set @List = CreateObject(“SubscriberList”)
SetObjectProperty(@List,”ID”,”3972″) /* List ID of FS Foresight */
SetObjectProperty(@List,”Status”,”Unsubscribed”)
AddObjectArrayItem(@sub,”Lists”, @List)
ENDIF

/* Keep repeating the above , one for each list */

Set @options = CreateObject(“UpdateOptions”)
Set @save = CreateObject(“SaveOption”)
SetObjectProperty(@save,”SaveAction”,”UpdateAdd”)
SetObjectProperty(@save,”PropertyName”,”*”)
AddObjectArrayItem(@options,”SaveOptions”, @save)

/* Here is where we actually update the Subscriber object */
Set @update_sub = InvokeUpdate(@sub, @update_sub_status, @update_sub_errorcode, @options)
IF @update_sub == “OK” THEN
]%%

Your Profile is updated successfully

%%[
ELSE
]%%

Error: Please try again later

%%[
ENDIF
]%%

Leave a comment

Blog at WordPress.com.

Up ↑