Saturday, August 31, 2013

Old dev files still showing up? Redirect w .htaccess: RedirectMatch 301 /dev(.*) http://yoursite.com$1

I know this is nothing groundbreaking, but just a quick reminder for me. Sometimes I am very reluctant to delete files in a dev folder, but I don't want them available to the public, so that's where .htaccess comes in.

I had worked on a site that had a new design located in a "dev" subfolder while it was be Q&A'd and eventually we copied all the files into the root folder to go live with the new site. But... there was a lone rouge button still pointing to a page in the dev folder. instead of going through the site looking for any other links to dev pages, I used .htaccess to redirect any links to a page with /dev in the path to the same page in the root directory.

RedirectMatch 301 /dev(.*) http://yoursite.com$1

Yes, I should have done this in the first place, but you live and learn.



Thursday, August 29, 2013

Home today w a sore chest, shoulder, and back. Pulled something at the gym and it's yelling and screaming at me.

I've been doing flat bench with free weights on and off for 30+ years. I have never hurt myself. I've jumped on the bench cold after not touching it for months and never pulled anything. Oh, I get sore as hell sometimes, but never injured. Thanks father time.

Wednesday, August 28, 2013

Heavy AMPscript coding last few days. ExactTarget so robust compared to Silverpop, but still like some SP things better

ExactTarget's AMPscript is so far advanced to Silverpop's WYSIWYG scripting. You can really do some cool stuff. I don't like how ET handles lists/databases though, but I'll take the great with the not so great.

I have been working on a project that needed a relational table connected to the recipient list. In ET they had a function called "data relationships" and a "multi-join" filter that seemed to be what I was looking for. But I spent a day going down that road and came to a dead end.

I called support and explained what I was trying to do and how I was looking at the data relationship function to try and do this. Well, they told me that this would not get er done. This was relating two tables, but it only a one-to-one relationship, and I needed one-to-many. 

The support person was even sure that what I wanted to do was possible. He suggested I talk with my "Relationship Manager". Well, this was the client's account and the client was using a 3rd party reseller, so that wasn't any help.

ET uses their own proprietary scripting language called AMPscript, so compared to other languages, there is not much info out there on it. They do have a lot of info on their own site and message boards, but it's seem like it's always a pain finding what I'm looking for, and this time was no different.

I eventually found an example that was in the ball park, and I was off and running after that. It took me quite a while to even see any light at the end of the tunnel. I couldn't find syntax for custom function, arrays, etc. 

At the time of this writing I have successfully connected to a table and extracted data from it, and rendered it in my email, so that's a huge step. I still need to loop through records and filter out empty fields. This might sound easy, but I'm dealing with a lot of unfamiliar syntax. 

Here's the key to it all working:

Connect to and get records:::
SET @multiRows = LookupRows("DATA_EXT_NAME","FIELD NAME",[SUBSCRIBER_KEY])

Loop through the rows:::
for @i = 1 to RowCount(@multiRows) do

Set @row = Row(@multiRows,@i)

Get data from the fields in the row::::
Set @LAST_NAME = Field(@row,"LAST_NAME")
Set @CLIENT_ID = Field(@row,"CLIENT_ID")
Set @PATIENT_ID = Field(@row,"PATIENT_ID")

 next @i 

I'm getting there. 

Friday, August 9, 2013

Logo iterations. I went through many more than this in the thumbnail phase.

My ExactTarget AMPscript skills come on a need-to-know basis. Learned a cool technique for styling dynamic tabular data.

It's not rocket science, and if this were JavaScript, PHP, etc. it would be a pretty easy thing, but AMPscript is proprietary and even though the documentation looks to be extensive, it never seems very easy to find what I'm looking for.

I first looked to create an array of values pulled from fields in the list, but I couldn't (relatively quickly) find the syntax for creating an array (not sure if it exists). For my purposes I needed to check about 10 different fields, so the code gets a little bloated, but not too bad. I should be looping through an array instead, but I digress.

I first check that the fields is not empty. I then have a nested condition that checks the value of a variable set for the background color of the table row. I toggle the background color every time, creating a nice readable banded table.

%%[ IF NOT EMPTY(@CLINIC_EXT_ID) THEN ]%%
  %%[ IF @rowColor == '#e1e1e1' THEN ]%%
  %%[ Set @rowColor = '#959595' ]%%
  %%[ ELSE ]%%
  %%[ Set @rowColor = '#e1e1e1' ]%%
  %%[ ENDIF ]%%
<tr style=”background-color:%%= v(@rowColor) =%%;”><td><strong>CLINIC EXT ID:</strong> </td><td>%%= v(@CLINIC_EXT_ID) =%%</td></tr>
%%[ ENDIF ]%%

finally saw a brochure cover I designed. Pretty cool since I don't do much print and don't have much physical evidence of my design work.