Bug 1213906-Change email invitation to fit new user journey, r=dmose
authorChris Rafuse <chris.rafuse@priologic.com>
Mon, 02 Nov 2015 14:09:39 -0800
changeset 270846 901a0736dd16ba366d2de0ec08cab975429fa4b2
parent 270845 88814a58c066bd4f2cbda7a719045f21b244f538
child 270847 436f6fab5d4e773138e128c7163238620aa40730
push id18459
push usercbook@mozilla.com
push dateTue, 03 Nov 2015 11:14:32 +0000
treeherderb2g-inbound@09173d8e6694 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmose
bugs1213906
milestone45.0a1
Bug 1213906-Change email invitation to fit new user journey, r=dmose
browser/components/loop/content/js/roomStore.js
browser/components/loop/content/js/roomViews.js
browser/components/loop/content/js/roomViews.jsx
browser/components/loop/content/shared/js/utils.js
browser/components/loop/test/desktop-local/roomStore_test.js
browser/components/loop/test/desktop-local/roomViews_test.js
browser/components/loop/test/shared/utils_test.js
browser/locales/en-US/chrome/browser/loop/loop.properties
--- a/browser/components/loop/content/js/roomStore.js
+++ b/browser/components/loop/content/js/roomStore.js
@@ -351,21 +351,21 @@ loop.store = loop.store || {};
      */
     shareRoomUrl: function(actionData) {
       var providerOrigin = new URL(actionData.provider.origin).hostname;
       var shareTitle = "";
       var shareBody = null;
 
       switch (providerOrigin) {
         case "mail.google.com":
-          shareTitle = mozL10n.get("share_email_subject6");
-          shareBody = mozL10n.get("share_email_body6", {
+          shareTitle = mozL10n.get("share_email_subject7");
+          shareBody = mozL10n.get("share_email_body7", {
             callUrl: actionData.roomUrl
           });
-          shareBody += mozL10n.get("share_email_footer");
+          shareBody += mozL10n.get("share_email_footer2");
           break;
         case "twitter.com":
         default:
           shareTitle = mozL10n.get("share_tweet", {
             clientShortname2: mozL10n.get("clientShortname2")
           });
           break;
       }
--- a/browser/components/loop/content/js/roomViews.js
+++ b/browser/components/loop/content/js/roomViews.js
@@ -263,20 +263,28 @@ loop.roomViews = (function(mozL10n) {
       };
     },
 
     handleEmailButtonClick: function(event) {
       event.preventDefault();
 
       var roomData = this.props.roomData;
       var contextURL = roomData.roomContextUrls && roomData.roomContextUrls[0];
+      if (contextURL) {
+        if (contextURL.location === null) {
+          contextURL = undefined;
+        } else {
+          contextURL = sharedUtils.formatURL(contextURL.location).hostname;
+        }
+      }
+
       this.props.dispatcher.dispatch(
         new sharedActions.EmailRoomUrl({
           roomUrl: roomData.roomUrl,
-          roomDescription: contextURL && contextURL.description,
+          roomDescription: contextURL,
           from: "conversation"
         }));
     },
 
     handleCopyButtonClick: function(event) {
       event.preventDefault();
 
       this.props.dispatcher.dispatch(new sharedActions.CopyRoomUrl({
--- a/browser/components/loop/content/js/roomViews.jsx
+++ b/browser/components/loop/content/js/roomViews.jsx
@@ -263,20 +263,28 @@ loop.roomViews = (function(mozL10n) {
       };
     },
 
     handleEmailButtonClick: function(event) {
       event.preventDefault();
 
       var roomData = this.props.roomData;
       var contextURL = roomData.roomContextUrls && roomData.roomContextUrls[0];
+      if (contextURL) {
+        if (contextURL.location === null) {
+          contextURL = undefined;
+        } else {
+          contextURL = sharedUtils.formatURL(contextURL.location).hostname;
+        }
+      }
+
       this.props.dispatcher.dispatch(
         new sharedActions.EmailRoomUrl({
           roomUrl: roomData.roomUrl,
-          roomDescription: contextURL && contextURL.description,
+          roomDescription: contextURL,
           from: "conversation"
         }));
     },
 
     handleCopyButtonClick: function(event) {
       event.preventDefault();
 
       this.props.dispatcher.dispatch(new sharedActions.CopyRoomUrl({
--- a/browser/components/loop/content/shared/js/utils.js
+++ b/browser/components/loop/content/shared/js/utils.js
@@ -386,27 +386,26 @@ var inChrome = typeof Components != "und
   function composeCallUrlEmail(callUrl, recipient, contextDescription, from) {
     var mozLoop = navigator.mozLoop;
     if (typeof mozLoop === "undefined") {
       console.warn("composeCallUrlEmail isn't available for Loop standalone.");
       return;
     }
 
     var subject, body;
-    var footer = mozL10n.get("share_email_footer");
-
+    var footer = mozL10n.get("share_email_footer2");
     if (contextDescription) {
-      subject = mozL10n.get("share_email_subject6");
-      body = mozL10n.get("share_email_body_context2", {
+      subject = mozL10n.get("share_email_subject7");
+      body = mozL10n.get("share_email_body_context3", {
         callUrl: callUrl,
         title: contextDescription
       });
     } else {
-      subject = mozL10n.get("share_email_subject6");
-      body = mozL10n.get("share_email_body6", {
+      subject = mozL10n.get("share_email_subject7");
+      body = mozL10n.get("share_email_body7", {
         callUrl: callUrl
       });
     }
     var bodyFooter = body + footer;
     bodyFooter = bodyFooter.replace(/\r\n/g, "\n").replace(/\n/g, "\r\n");
     mozLoop.composeEmail(
       subject,
       bodyFooter,
--- a/browser/components/loop/test/desktop-local/roomStore_test.js
+++ b/browser/components/loop/test/desktop-local/roomStore_test.js
@@ -548,17 +548,17 @@ describe("loop.store.RoomStore", functio
           roomUrl: roomUrl,
           provider: {
             origin: origin
           }
         }));
 
         sinon.assert.calledOnce(fakeMozLoop.socialShareRoom);
         sinon.assert.calledWithExactly(fakeMozLoop.socialShareRoom, origin,
-          roomUrl, "share_email_subject6", "share_email_body6" + "share_email_footer");
+          roomUrl, "share_email_subject7", "share_email_body7" + "share_email_footer2");
       });
 
       it("should pass the correct data for all other Social Providers", function() {
         var roomUrl = "http://invalid2";
         var origin = "https://twitter.com/share";
         store.shareRoomUrl(new sharedActions.ShareRoomUrl({
           roomUrl: roomUrl,
           provider: {
--- a/browser/components/loop/test/desktop-local/roomViews_test.js
+++ b/browser/components/loop/test/desktop-local/roomViews_test.js
@@ -207,17 +207,18 @@ describe("loop.roomViews", function() {
         savingContext: false,
         show: true,
         showEditContext: false
       }, props);
       return TestUtils.renderIntoDocument(
         React.createElement(loop.roomViews.DesktopRoomInvitationView, props));
     }
 
-    it("should dispatch an EmailRoomUrl action when the email button is pressed",
+    it("should dispatch an EmailRoomUrl with no description" +
+       " for rooms without context when the email button is pressed",
       function() {
         view = mountTestComponent({
           roomData: { roomUrl: "http://invalid" }
         });
 
         var emailBtn = view.getDOMNode().querySelector(".btn-email");
 
         React.addons.TestUtils.Simulate.click(emailBtn);
@@ -226,36 +227,35 @@ describe("loop.roomViews", function() {
         sinon.assert.calledWith(dispatcher.dispatch,
           new sharedActions.EmailRoomUrl({
             roomUrl: "http://invalid",
             roomDescription: undefined,
             from: "conversation"
           }));
       });
 
-    it("should dispatch a different EmailRoomUrl action for rooms with context",
+    it("should dispatch an EmailRoomUrl with a domain name description for rooms with context",
       function() {
         var url = "http://invalid";
-        var description = "Hello, is it me you're looking for?";
         view = mountTestComponent({
           roomData: {
             roomUrl: url,
-            roomContextUrls: [{ description: description }]
+            roomContextUrls: [{ location: "http://www.mozilla.com/" }]
           }
         });
 
         var emailBtn = view.getDOMNode().querySelector(".btn-email");
 
         React.addons.TestUtils.Simulate.click(emailBtn);
 
         sinon.assert.calledOnce(dispatcher.dispatch);
         sinon.assert.calledWith(dispatcher.dispatch,
           new sharedActions.EmailRoomUrl({
             roomUrl: url,
-            roomDescription: description,
+            roomDescription: "www.mozilla.com",
             from: "conversation"
           }));
       });
 
     describe("Copy Button", function() {
       beforeEach(function() {
         view = mountTestComponent({
           roomData: { roomUrl: "http://invalid" }
--- a/browser/components/loop/test/shared/utils_test.js
+++ b/browser/components/loop/test/shared/utils_test.js
@@ -317,23 +317,23 @@ describe("loop.shared.utils", function()
 
   describe("#composeCallUrlEmail", function() {
     var composeEmail, telemetryAddValue;
 
     beforeEach(function() {
       // fake mozL10n
       sandbox.stub(navigator.mozL10n, "get", function(id) {
         switch (id) {
-          case "share_email_subject6":
+          case "share_email_subject7":
             return "subject";
-          case "share_email_body6":
+          case "share_email_body7":
             return "body";
-          case "share_email_body_context2":
+          case "share_email_body_context3":
             return "body_context";
-          case "share_email_footer":
+          case "share_email_footer2":
             return "footer";
         }
       });
       composeEmail = sandbox.spy();
       telemetryAddValue = sandbox.spy();
       navigator.mozLoop = {
         SHARING_ROOM_URL: {
           EMAIL_FROM_CALLFAILED: 2,
--- a/browser/locales/en-US/chrome/browser/loop/loop.properties
+++ b/browser/locales/en-US/chrome/browser/loop/loop.properties
@@ -54,25 +54,25 @@ check_internet_connection=Please check y
 login_expired=Your Login Has Expired
 service_not_available=Service Unavailable At This Time
 problem_accessing_account=There Was A Problem Accessing Your Account
 
 ## LOCALIZATION NOTE(retry_button): Displayed when there is an error to retry
 ## the appropriate action.
 retry_button=Retry
 
-share_email_subject6=Join me for a video conversation
-## LOCALIZATION NOTE (share_email_body6): In this item, don't translate the
+share_email_subject7=Your invitation to browse the Web together
+## LOCALIZATION NOTE (share_email_body7): In this item, don't translate the
 ## part between {{..}} and leave the \n\n part alone
-share_email_body6=Click the Firefox Hello link to connect to the conversation now: {{callUrl}}
-## LOCALIZATION NOTE (share_email_body_context2): In this item, don't translate
+share_email_body7=A friend is waiting for you on Firefox Hello. Click the link to connect and browse the Web together: {{callUrl}}
+## LOCALIZATION NOTE (share_email_body_context3): In this item, don't translate
 ## the part between {{..}} and leave the \n\n part alone.
-share_email_body_context2=Join me for a video conversation. Click the Firefox Hello link to connect now: {{callUrl}}\n\nLet’s talk about this during our conversation: {{title}}
-## LOCALIZATION NOTE (share_email_footer): Common footer content for both email types
-share_email_footer=\n\n________\nJoin and create video conversations free with Firefox Hello. Connect easily over video with anyone, anywhere. No downloads or registration. Learn more at http://www.firefox.com/hello
+share_email_body_context3=A friend is waiting for you on Firefox Hello. Click the link to connect and browse {{title}} together: {{callUrl}}
+## LOCALIZATION NOTE (share_email_footer2): Common footer content for both email types
+share_email_footer2=\n\n____________\nFirefox Hello lets you browse the Web with your friends. Use it when you want to get things done: plan together, work together, laugh together. Learn more at http://www.firefox.com/hello
 ## LOCALIZATION NOTE (share_tweeet): In this item, don't translate the part
 ## between {{..}}. Please keep the text below 117 characters to make sure it fits
 ## in a tweet.
 share_tweet=Join me for a video conversation on {{clientShortname2}}!
 
 share_add_service_button=Add a Service
 
 ## LOCALIZATION NOTE (copy_link_menuitem, email_link_menuitem, delete_conversation_menuitem):
@@ -211,16 +211,21 @@ no_conversations_message_heading2=No con
 ## LOCALIZATION NOTE(no_conversations_start_message2): Subheading inviting the
 ## user to start a new conversation.
 no_conversations_start_message2=Start a new one!
 
 # LOCALIZATION NOTE (context_inroom_header): this string is displayed in the
 # conversation window when the user edits context. It is a header to the edit
 # section.
 context_inroom_header=Let's Talk About…
+# LOCALIZATION NOTE (context_inroom_label2): this string is followed by the
+# title and domain of the website you are having a conversation about, displayed on a
+# separate line. If this structure doesn't work for your locale, you might want
+# to consider this as a stand-alone title. See example screenshot:
+# https://bug1115342.bugzilla.mozilla.org/attachment.cgi?id=8563677
 context_edit_name_placeholder=Conversation Name
 context_edit_comments_placeholder=Comments
 context_cancel_label=Cancel
 context_done_label=Done
 conversation_settings_menu_edit_context=Edit Context
 conversation_settings_menu_hide_context=Hide Context