SUNDOG SPOTLIGHT: AMY

The spotlights are making a comeback and it’s this Minneapolis gal’s birthday week! What better way to celebrate than throwing Amy Crews in the spotlight:

Amy

Position at Sundog: 
I’m a Senior Designer. The “Designer” means I can improve the way things look and the “Senior” means I’ve been doing it for many years ;)

Work experience: 
I’ve been able to work with a lot of great companies that helped make me who I am today. Most recently JM Cremps, which is a toy store for boys. If you go to the second floor (N240) of Mall of America, my son is even on the 12 ft. sign in the front of the store.

Things that make you go “hmmm”:
After they make Styrofoam, what do they ship it in?

Tell us about your family: 
My husband’s name is Wade. He is a Nurse Practitioner working in Sartell and has been putting up with me for 15 years now. We have 3 boys (ages 8 – Ethan, 9 – Matthew and 11 – Gavin). I am usually at some sort of field – whether that’s baseball or football – almost every night of the week.

Most recent purchase:
A hot water heater. We had to wait a week in order to get someone to come and fix it, so I really appreciate a hot shower!

What you’re doing when you’re not at the office:
Besides going to the boys’ events, I like camping, biking and going to the gun range with the boys.

Secret Power You Wish You Had: 
I really do have a secret power, but I can’t tell you because then it won’t be a secret.

Thing That Makes You Cringe: 
Blood

#1 Book You Recommend:
Unbroken by Laura Hilenbrand – It makes your day seem “not so bad.”

Posted in Technology | Tagged , | Leave a comment

WHAT EMAIL CLIENTS SHOULD I TEST ON?

The email landscape has changed dramatically over the last several years. Two years ago, Outlook was still holding on to 20% of the market share despite mobile’s increasing influence. Now, Outlook is down to 9% and Gmail has doubled its popularity to 16% of the market share.

NOTE: These statistics are based on open rates which can only be tracked when images are loaded. Gmail used to block images by default and now allows images to load by default which probably contributed to its apparent growth.

TOP TEN…WITH ONE CATCH

Email Client Market Share keeps a running tally of the top ten email clients and mobile applications. This list is a great place to start your testing, but make sure you also understand your own unique audience. If your audience is young people, most likely you’ll see a higher mobile demographic than if your audience is middle-age, non-technical folks.

Know your audience and understand what they want. You want your emails to look good, but also to be practical and useful for your audience to engage with. No matter how stunning an email looks and regardless of how perfectly cross-client it is, if the content is not relevant and interesting to your audience, they won’t engage with it.

Posted in Technology | Tagged , | Leave a comment

THE LIFE & LEGACY OF OUTLOOK

Outlook was born in 1997 to parents Windows and Office. It has lived a long and popular life despite being the object of much debate among those who know him best. His decisions and business choices have left lasting effects on the industry making many friends and enemies.

He reached the pinnacle of his career early in life and enjoyed position, popularity, and affluence. Up until 2003, his business rendering partner was I.E., but in 2007, he made his most controversial decision in which he let his partner go and aligned himself instead with M.S. Word, a decision which proved to be disastrous for the industry at large with ripple effects even today.

Despite the public outcry from developers who were frustrated by his fickle nature and lack of industry standards, Outlook followers appeared to remain loyal to the system. Although his knowledgeable critics suspect that coercion, apathy, or simply habit were the only things keeping them from leaving.

Today, Outlook still has a strong hold on the industry and in January of 2015 was still holding on to 9% of the market share, despite a loosening hold in recent years. No one knows what the future holds for Outlook, but some are still hoping he will recant his early decisions and set things right for the future.

Posted in Technology | Tagged , , | Leave a comment

CALLING AMAZON MWS – PART 4

In my last blog post ‘Calling Amazon MWS – Part 3’ we looked at the GetReportRequestList Amazon MWS API call.  The GetReportRequestList call asks Amazon if a report is “_DONE_” that we had requested earlier to be generated.

There would be some type of polling mechanism with a scheduled/batch job that would keep calling GetReportRequestList until we get back that “_DONE_” status.

Now that we are “_DONE_” we can finally make the GetReport call to actually get the report data.  This report can be extremely long if you have sold a lot of products within the date range you specified when the report was requested.

Here is how the GetReport call can be made in APEX on Salesforce.  The myObject__c would be a custom object that would hold the credentials to make the call and also the GeneratedReportID__c value which was returned from the GetReportRequestList call.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
public static string doGetReportCall(myObject__c rl){
    string returnXML ='';     
            
    String request ='AWSAccessKeyId='+urlencode(rl.Access_Key_ID__c) +
                '&Action='+urlencode('GetReport') +
                '&Merchant='+urlencode(rl.Seller_ID__c) +
                '&ReportId='+urlencode(rl.GeneratedReportID__c) +
                '&SignatureMethod='+urlencode('HmacSHA256') +
                '&SignatureVersion='+urlencode('2') +
                '&Timestamp='+urlencode(getTimeStampNow()) +                                                                          
                '&Version='+urlencode('2009-01-01');
         
    String canonical = 'POST'+'\n'+
                          rl.Service_URL__c +'\n'+
                          '/\n'+
                          request;
    String key = rl.Secret_Key__c;    
        String signature = getSignature(canonical, key);
        String body = request +'&Signature=' + urlEncode(signature);
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setCompressed(true);
        req.setHeader('Host', rl.Service_URL__c);
        req.setHeader('Content-Type','text/xml');
        req.setHeader('x-amazon-user-agent','Salesforce');
        req.setEndpoint(rl.End_Point__c +'/?'+body);
        req.setMethod('POST');
     req.setTimeout(60000);
        
     // Send the request, and return a response   
     string bodyValue ='';
     if(test.isRunningTest()){
          bodyValue ='<?xml version="1.0"?>' +
            '<amazonenvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nonamespaceschemalocation="amzn-envelope.xsd">' +
            '<header>' +
            '<documentversion>1.00</documentversion>' +
            '</header>' +
            '<messagetype>AllOrdersReport</messagetype>' +
            '<message>' +
                '<order>' +
                    '<amazonorderid>204-9999999-811144</amazonorderid>' +
                    '<merchantorderid>204-9999999-811144</merchantorderid>' +
                    '<purchasedate>2015-01-22T15:38:29+00:00</purchasedate>' +
                    '<lastupdateddate>2015-01-24T03:17:51+00:00</lastupdateddate>' +
                    '<orderstatus>Shipped</orderstatus>' +
                    '<saleschannel>Amazon.co.uk</saleschannel>' +
                    '<fulfillmentdata>' +
                        '<fulfillmentchannel>Amazon</fulfillmentchannel>' +
                        '<shipservicelevel>Standard</shipservicelevel>' +
                        '<address>' +
                            '<city>EastSide</city>' +
                            '<postalcode>UB99 1SY</postalcode>' +
                            '<country>GB</country>' +
                        '</address>' +
                    '</fulfillmentdata>' +
                    '<orderitem>' +
                        '<asin>B045EN4KJI</asin>' +
                        '<sku>uk-effq-cat-leash</sku>' +
                        '<itemstatus>Shipped</itemstatus>' +
                        '<productname>Cat Leash</productname>' +
                        '<quantity>1</quantity>' +
                        '<itemprice>' +
                            '<component>' +
                                '<type>Principal</type>' +
                                '<amount currency="GBP">76.95</amount>' +
                            '</component>' +
                        '</itemprice>' +
                    '</orderitem>' +
                '</order>' +
            '</message>' +
            '<message>' +
                '<order>' +
                    '<amazonorderid>202-9124543-8311135</amazonorderid>' +
                    '<merchantorderid>202-9124543-8311135</merchantorderid>' +
                    '<purchasedate>2015-01-21T22:57:20+00:00</purchasedate>' +
                    '<lastupdateddate>2015-01-22T11:03:24+00:00</lastupdateddate>' +
                    '<orderstatus>Shipped</orderstatus>' +
                    '<saleschannel>Amazon.co.uk</saleschannel>' +
                    '<fulfillmentdata>' +
                    '<fulfillmentchannel>Amazon</fulfillmentchannel>' +
                    '<shipservicelevel>Expedited</shipservicelevel>' +
                    '<address>' +
                    '<city>LONDON</city>' +
                    '<state>StateValue</state>' +
                    '<postalcode>AA1 6NA</postalcode>' +
                    '<country>GB</country>' +
                    '</address>' +
                    '</fulfillmentdata>' +
                    '<orderitem>' +
                    '<asin>B00NTY4KJI</asin>' +
                    '<sku>uk-wigzi-rabbit-leash</sku>' +
                    '<itemstatus>Shipped</itemstatus>' +
                    '<productname>Rabbit Leash</productname>' +
                    '<quantity>2</quantity>' +
                    '<itemprice>' +
                    '<component>' +
                    '<type>Principal</type>' +
                    '<amount currency="GBP">41.23</amount>' +
                    '</component>' +
                    '</itemprice>' +
                    '</orderitem>' +
                '</order>' +
            '</message>' +
            '</amazonenvelope>';
        }else{
          HttpResponse res = h.send(req);
          bodyValue = res.getBody();
        }
        
        System.debug(bodyValue);
        returnXML = bodyValue;
        return returnXML;
    }

Yeah!  We have back our orders in our report!

Now once you get your XML you just need to parse it.  Here is an ‘oldie but a goodie’ blog post that can help you get started with that XML parsing: Parsing XML in Salesforce APEX

There is a new way to handle the ‘if(test.isRunningTest()){’ code above by using the HttpMock and WebserviceMock interfaces.  The reason for the work-around is because you cannot make the actual call-out while a test is running.  The actual call-out line is HttpResponse res = h.req.send(req);  The one thing about using HttpMock with tests is that you can still run into the problem where you need to insert test data before making your fake callout.  This will result in an error since you cannot do DML statements before a callout.  So in the end you may end up using the Test.isRunningTest() option anyway.

Good luck with your Amazon MWS integrations!  I hope these blog posts have helped to get you started.

If you ever need any help with your integrations please reach out to us at Sundog.  We will help you get your data to the proper destination.

Posted in Technology | Tagged , , , | Leave a comment

CALLING AMAZON MWS – PART 3

In my last blog post ‘Calling Amazon MWS – Part 2’ we looked at the RequestReport Amazon MWS API call.  The RequestReport call asks Amazon to run a report for us. It does not return the report right away as this is just a request to do a report.

Now we basically need to poll the Amazon MSW to keep asking it: ‘Is my report done yet?’  This can be done by having a scheduled APEX job in Salesforce call an APEX batch job.

The call we need to make is called GetReportRequestList.  I do encourage you to use the Amazon MWS Scratchpad site to get a sense as to the request parameters and response values involved with this call.

Here is the code needed to make this call work.  The myObject__c would be a custom object that would hold the credentials to make the call and also the Report_Request_ID value which was returned from the RequestReport call.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
public static string doGetReportRequestListCall(myObject__c rl){
        string returnXML ='';
            
        String request ='AWSAccessKeyId='+urlencode(rl.Access_Key_ID__c) +
                '&Action='+urlencode('GetReportRequestList') +
                '&Merchant='+urlencode(rl.Seller_ID__c) +
                '&ReportRequestIdList.Id.1='+urlencode(rl.Report_Request_ID__c) +
                '&SignatureMethod='+urlencode('HmacSHA256') +
                '&SignatureVersion='+urlencode('2') +
                '&Timestamp='+urlencode(getTimeStampNow()) +                                                                          
                '&Version='+urlencode('2009-01-01');
         
        String canonical = 'POST'+'\n'+
                          rl.Service_URL__c +'\n'+
                          '/\n'+
                          request;
        String key = rl.Secret_Key__c;    
            String signature = getSignature(canonical, key);
        String body = request +'&Signature=' + urlEncode(signature);
            Http h = new Http();
            HttpRequest req = new HttpRequest();
            req.setCompressed(true);
            req.setHeader('Host', rl.Service_URL__c);
            req.setHeader('Content-Type','text/xml');
            req.setHeader('x-amazon-user-agent','Salesforce');
            req.setEndpoint(rl.Credential__r.End_Point__c +'/?'+body);
            req.setMethod('POST');
        req.setTimeout(60000);
        
        // Send the request, and return a response   
        string bodyValue ='';
        if(test.isRunningTest()){
          bodyValue ='<?xml version="1.0"?>' +
            '<getreportrequestlistresponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">' +
            '<getreportrequestlistresult>' +
              '<nexttoken>' +
              '<hasnext>false</hasnext>' +
              '<reportrequestinfo>' +
                '<reportrequestid>59999916457</reportrequestid>' +
                '<reporttype>_GET_XML_ALL_ORDERS_DATA_BY_ORDER_DATE_</reporttype>' +
                '<startdate>2015-01-22T04:22:20+00:00</startdate>' +
                '<enddate>2015-01-22T04:22:20+00:00</enddate>' +
                '<scheduled>false</scheduled>' +
                '<submitteddate>2015-01-22T04:22:20+00:00</submitteddate>' +
                '<reportprocessingstatus>_DONE_</reportprocessingstatus>' +
                '<generatedreportid>23654732683</generatedreportid>' +
                '<startedprocessingdate>2015-01-22T04:22:31+00:00</startedprocessingdate>' +
                '<completeddate>2015-01-22T04:22:32+00:00</completeddate>' +
              '</reportrequestinfo>' +
            '</nexttoken></getreportrequestlistresult>' +
            '<responsemetadata>' +
              '<requestid>4116eb8a-e22c-4bb9-81e0-1ee4fb8c9fb7</requestid>' +
            '</responsemetadata>' +
            '</getreportrequestlistresponse>';
        }else{
          HttpResponse res = h.send(req);
          bodyValue = res.getBody();
        }
        
        System.debug(bodyValue);
        returnXML = bodyValue;
        return returnXML;
    }
public static string getTimeStampNow(){
        Datetime now = Datetime.now().addDays(1);
        String timestamp = now.formatGmt('yyyy-MM-dd')+'T'+now.formatGmt('HH:mm:ss')+'Z';
        return timestamp;
}
public static string getSignature(string canonical, string key){
    String signature;
        Blob bsig = Crypto.generateMac('HmacSHA256', Blob.valueOf(canonical), Blob.valueOf(key));
    signature = EncodingUtil.base64Encode(bsig);
    return signature;
}

Calling GetReportRequestList ends up being very similar to called RequestReport.  Even the XML returned in the response is nearly identical.

One of the most important lines in the response is the “<ReportProcessingStatus>_DONE_</ReportProcessingStatus>” section.  If it is “_DONE_” then the report is ready to be retrieved.

In the next blog post we will actually get the report data itself with the GetReport call.

 

Posted in Technology | Tagged , , , | Leave a comment

EMAIL INTERVIEW TAKE-AWAYS

How well do you know your audience? Have you talked to them recently? What do they think of your email campaigns? Do they mark your emails as “star” or “spam” when they see them?

I talked to three individuals this week ranging from young to grandpa. Here are some high points from their interviews.

What hit me most from these interviews was how financially driven their motives were. They tolerated unusual amounts of email in the name of a coveted promo code when they needed it, even expressing frustration when retailers wasted their time on frivolous “deals.”

Marissa told me that though she opens nearly all her email on her smartphone, she usually defers on marketing or catalog-type emails and waits for time on a computer because usually the pictures are too small to be useful. I thought this was interesting! Marketers are really missing a golden opportunity by not optimizing their emails for mobile. Here at Sundog, responsive is part of our DNA.

Jenny mentioned that she gets an “insane” amount of emails and only has time to look at the ones that stand out and emphasized the importance of a clear subject since that’s all she can see on her smartphone.

Another thing that caught my attention was a comment from Jer who told me about the shoe manufacturer who was sending him 2-3 emails a week. Why would a shoe company think he needed another pair of shoes later that week? Come on – he’s a guy! Take his advice and make sure your email campaigns are product-appropriate.

A common theme among all three was that the main reason they unsubscribed was because they were receiving emails too frequently. While their thresholds varied, most agreed that anything more than once a week was out of line.

While you may think you know your audience backwards and forwards, it’s never a bad idea to touch base with the real world every once in a while; they usually know what they’re talking about. If we want to reach them, we have to know what they want.

Posted in Technology | Tagged , , | Leave a comment

INTERVIEWS WITH EMAIL USERS: MARISSA

Let me introduce you to Marissa. She’s a recent college grad working a job she loves. She’s technically savvy, as are most of her generation. Last week, I had a nice chat with her about how she perceives and uses promotional emails. Here’s what we can learn from her as a typical, young consumer.

What motivates you to subscribe to emails from sellers?

  • Deals, sales, & promo codes
  • New merchandise announcements
  • Informational emails based on hobbies or interests

When do you unsubscribe from emails?

  • Receiving too many emails
  • Sick of deleting emails that have no value
  • Signed up for a specific deal at time of purchase to get discount, but then no longer needed
  • Unsolicited spam
  • May keep it for up to a year in case something good comes up, but unsubscribes eventually if nothing is meaningful

What kind of emails are you currently receiving from which you don’t plan to unsubscribe?

  • Sites used frequently (or at least often enough to warrant deleting the emails in between the ones that get used)
  • Informational emails about areas of interest (not technically a marketing email)

Do you keep marketing emails in your inbox or delete them?

  • Usually I delete them, but if it’s something I want to look at again, I’ll keep it

Words of wisdom to retailers?

  • Don’t send too frequently
  • If retailer plans to send emails on a variety of topics, give me a category of choices to choose from (I don’t want to know about fabric softener if I’m interested in kitchen supplies)
  • Don’t make me subscribe to an email list just to get one deal at time of purchase
  • Don’t send unsolicited emails…please!
Posted in Technology | Tagged , , | Leave a comment

FIVE (MORE) GREAT CONTENT STRATEGY READS

Last summer, I highlighted a few great content strategy reads and it’s time for a new roundup of content geekiness. Check these out:

4 Ways to Boost Your Content Strategy (Creative Bloq)
Why you should read it: In this Q&A, Kristina Halvorson shares several observations about the state of content strategy – and where content strategists should focus their time and efforts.
In their words: “Why, what, how, for whom, by whom, when, where, what next. Change the conversation not by telling, but by asking. Be a consultant, not a tactician. Help people face up to the fact that content can no longer be the thing that fills the buckets – it has to be the reason we design and build in the first place.”

Social Media Update 2014 (Pew Research Center)
Why you should read it: Pew’s new study of social media demographic trends highlights several trends that can guide your strategies.
In their words: “While Facebook remains the most popular social media site, its overall growth has slowed and other sites continue to see increases in usership.”

Your Digital Strategy Shouldn’t Be About Attention (Harvard Business Review)
Why you should read it: This post from Umair Haque reminds us that sustainable and effective digital strategies revolve around the needs and goals of people, rather than hollow metrics like attention or engagement.
In their words: “What every institution needs — and what every leader needs to develop — before a ‘digital strategy’ is a human strategy. If you want to matter to people, you must do more than merely win their fickle, fleeting, frenzied attention. You must help them develop into the people they were meant to be. When you do, maybe, just maybe, they’ll reward you. With something greater than their grudging, wearied attention. Their lasting respect, enduring trust, and undying gratitude.”

Less Training, More Practice (Sara Wachter-Boettcher)
Why you should read it: Sara contends that content editors shouldn’t be “trained” how to use the shiny new CMS. Instead, they should be offered opportunities to practice how to create better content, with the goal of gradually changing their habits. She offers exercises and approaches to support this shift.
In their words: “Training sessions and screenshots of CMS interfaces are a start, but they’ll never help a team of content creators and managers own the content process. That’s what practice is for.”

New Altimeter Group Research: A Culture of Content (Altimeter Group)
Why you should read it: This post summarizes the new Altimeter Group report on how various organizations have created strong content cultures that advances the brand.
In their words: “Content is bigger than any one department. A content engine empowers teams and infuses content across marketing and other critical functions like social selling, employee advocacy, customer service, audience engagement and hiring.”

Posted in Technology | Tagged | Leave a comment

CALLING AMAZON MWS – PART 2

In order to get a report out of Amazon MWS you have to request the report to be run.  It does not return the report right away, but instead puts the report into a queue to be processed.  Later we will have to make another call ‘GetReportRequestList’ to see if the report is done and then finally another call ‘GetReport’ to actually retrieve the report.

In my first blog post about Amazon MWS called ‘Calling Amazon MWS – Part 1’ we saw when using the Amazon MWS Scratchpad all the authentication strings needed to make these various calls.  There are two main places these types of credential values can be stored.
1) In a Custom Object
2) In a Custom Setting
A custom object allows you to enter the data into an encrypted field, while the custom setting allows you to have only Admins have access to them so they each have their pros/cons.  In this example we will see a custom object being used.

So here is the code to make the call…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
public static string makeRequestReportCall(SecurityFields__c c){
        string returnXML ='';
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(c.End_Point__c);
       
            Datetime now = Datetime.now().addDays(1);
        String timestamp = now.formatGmt('yyyy-MM-dd')+'T'+now.formatGmt('HH:mm:ss')+'Z';
        DateTime start_dt;
        DateTime end_dt;
        if(c.Start_Date__c == null){
            start_dt = dateTime.Now().addDays(-30);
            }else{
            start_dt = c.Start_Date__c;
            }
        
        if(c.End_Date__c == null){
            end_dt = dateTime.Now();
            }else{
            end_dt = c.End_Date__c;
            }
        
        String start_date = start_dt.formatGmt('yyyy-MM-dd')+'T'+start_dt.formatGmt('HH:mm:ss')+'Z';
        String end_date = end_dt.formatGmt('yyyy-MM-dd')+'T'+end_dt.formatGmt('HH:mm:ss')+'Z';
     
        String request ='AWSAccessKeyId='+urlencode(c.Access_Key_ID__c) + 
                '&Action='+urlencode('RequestReport') +
                '&EndDate=' + urlencode(end_date)+
                '&MarketplaceIdList.Id.1='+urlencode(c.Marketplace_ID__c) +
                '&Merchant='+urlencode(c.Seller_ID__c) +
                '&ReportType=' + urlencode( '_GET_XML_ALL_ORDERS_DATA_BY_ORDER_DATE_')  +
                '&SignatureMethod='+urlencode('HmacSHA256') +
                '&SignatureVersion='+urlencode('2') +
                '&StartDate='+urlencode(start_date) +
                '&Timestamp='+urlencode(timestamp) +                                                                          
                '&Version='+urlencode('2009-01-01');
         
        String canonical = 'POST'+'\n'+
                          c.Service_URL__c +'\n'+
                          '/\n'+
                          request;
        String key = c.Secret_Key__c;
         
            String signature = getSignature(canonical, key);    
        String body = request +'&Signature=' + urlEncode(signature);
            
            Http http = new Http();
            req.setCompressed(true);
            req.setHeader('Host', c.Service_URL__c);
            req.setHeader('Content-Type','text/xml');
            req.setHeader('x-amazon-user-agent','Salesforce');
            req.setEndpoint(c.End_Point__c +'/?'+body);
            req.setMethod('POST');
        req.setTimeout(60000);
  
        string bodyValue ='';
        if(test.isRunningTest()){
          bodyValue ='<?xml version="1.0"?>' +
            '<requestreportresponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">' +
              '<requestreportresult>' +
                '<reportrequestinfo>' +
                  '<reportrequestid>9999999999</reportrequestid>' +
                  '<reporttype>_GET_XML_ALL_ORDERS_DATA_BY_ORDER_DATE_</reporttype>' +
                  '<startdate>2009-01-21T02:10:39+00:00</startdate>' +
                  '<enddate>2009-02-13T02:10:39+00:00</enddate>' +
                  '<scheduled>false</scheduled>' +
                  '<submitteddate>2009-02-20T02:10:39+00:00</submitteddate>' +
                  '<reportprocessingstatus>_SUBMITTED_</reportprocessingstatus>' +
                '</reportrequestinfo>' +
              '</requestreportresult>' +
              '<responsemetadata>' +
                '<requestid>99faca76-b600-46d2-b53c-0c1a4533e22a</requestid>' +
              '</responsemetadata>' +
            '</requestreportresponse>';
        }else{
          HttpResponse res = h.send(req);
          bodyValue = res.getBody();
        }
        
        System.debug(bodyValue);
        returnXML = bodyValue;
        return returnXML;
}
public static string getSignature(string canonical, string key){
        String signature;
                Blob bsig = Crypto.generateMac('HmacSHA256', Blob.valueOf(canonical), Blob.valueOf(key));
        signature = EncodingUtil.base64Encode(bsig);
        return signature;
}

There were two main posts on the Salesforce Developer Discussion Forums site that allowed me to reach the above solution.  One and Two.  Thank you so much to those contributors.

Notice the getSignature() method near the end of the code.  Originally I was having some errors here because I was encoding my values twice.  But the above code allows for the connection to succeed.

Now once you get your XML you just need to parse it.  Here is an ‘oldie but a goodie’ blog post that can help you get started with that XML parsing: Parsing XML in Salesforce APEX

In my next two blog posts I look forward to diving into the call ‘GetReportRequestList’ to see if the report is done and then finally another call ‘GetReport’ to actually retrieve the report.

Happy Integrating!

Posted in Technology | Tagged , , , | Leave a comment

INTERVIEWS WITH EMAIL USERS: JER

And this is Jer. He’s a proud grandpa and if he had a smartphone, he’d be showing you pictures of his newest grandson! As a member of the silver-hair club, he’s more comfortable shuffling paper than traversing the computer landscape, but he’s active on his email and knows a good deal when he sees one.

What motivates you to subscribe to emails from sellers?

  • Coupons, specials, sales, and discounts
  • Looking for informational emails with relevant content related to an interest

When do you unsubscribe from emails?

  • Too many emails!
  • No longer interested
  • Bought what I want – no longer needed
  • Spammy-looking

What kind of emails are you currently receiving from which you don’t plan to unsubscribe?

  • Ones that have information I’m following, whether news or product-oriented
  • Emails with content that interests me

Do you keep marketing emails in your inbox or delete them?

  • Delete when done
  • Occasionally will save something to reference later

Words of wisdom to retailers?

  • Don’t send too many!
  • Not more than once a week at the most
  • If I’m not actively purchasing, don’t bug me so frequently. Maybe one every three months would be acceptable just to remind me every once in a while.
  • Let me choose what I’m interested in and then notify me when it’s on sale. You’ll get my attention right away!
  • I bought from a shoe company, then got 2-3 emails per week. So I unsubscribed. However, if they had sent a special once every six months, I might look at it, but I don’t need another pair of shoes next week!
Posted in Technology | Tagged , , | Leave a comment