Key Information

Register
Submit
The challenge is finished.

Challenge Overview

1.     Project Overview

1.1     System Description

When a user is created in a Google Apps domain with Gmail enabled for the first time or moved into an organizational unit with Gmail enabled several messages are deleted from the user’s inbox.  At the same time other emails should be inserted into user's mailbox. The Welcome Message Removal Insertion Tool (WMRI Tool) will permanently delete these messages as soon as possible from the user's Gmail inbox and insert one or more messages.

1.2     Competition Task Overview

A complete list of deliverables can be found in the TopCoder Assembly Competition Tutorial at:

http://apps.topcoder.com/wiki/display/tc/Assembly+Competition+Tutorials

This challenge should split deletion and insertion process and support rich text messages and attachments.

Split deletion and insertion:

The current insertion function relies on deletion function now. It must run deletion task first and then run the insertion task.

The order of the process should be completely split such that messages can be inserted without any messages being deleted. 
Therefore, there should be 2 watchers, 1 for deleting messages and 1 for inserting messages. This will then allow for the 2 processes to be completely independent of each other.

The new insertion watcher will watch for the same 4 changes:

  • CREATE_USER
  • CHANGE_LAST_NAME
  • CHANGE_FIRST_NAME
  • MOVE_USER_TO_ORG_UNIT

Then the code should check the insertion messages' settings to see which ones apply and send the appropriate messages. Use the task queue to manage the message insertions.

The insertion tasks should have the same retry and email notification rules applied as the message deletion.

Rich Text Message and Attachments:

This challenge should use Gmail draft message to manage the welcome messages.

Steps:

  1. User@domain.com creates a draft in their Gmail
  2. User@domain.com logs into the the tool
  3. Tool displays a list of user@domain.com drafts
  4. User selects the desired draft
  5. Tool copies raw version of the draft
  • 1 - Edit an existing configuration or add new:
    • Selecting Add, will display a popup/overlay to choose an existing Draft from the currently logged in user's Gmail. 
      • There will be a link to open Gmail to create a draft.
      • There will be a refresh button to reload the list of drafts.
      • There will be 2 buttons OK and Cancel to confirm or cancel the message creation.
      • After selecting a draft and clicking OK a new Message will be populated and saved in SQL like it does now.
  • Selecting an existing message will display the configurable settings:
    • 2 - Choose the events
    • 3 - Edit the configuration
      • Title new config which will default to the message subject on create but can be modified independently.
      • Sender manually provided. Ignore any sender supplied in a draft message.
      • Message Subject and Message Body to be replaced with View Message button which will create a new draft in the currently logged in user's Gmail and then open the draft in a new tab or window.
        • Only populate the draft's subject, body, and attachments. 
    • 4 - Choose OUs to be included to send welcome messages
       
  • Change Edit to Update which will then bring up the same popup/overlay from the Add button but after choosing a draft it overwrites the currently selected message with the selected draft.
     
  • Update the SQL EmailMessage Schema to include attachments.  Attachments will be typically docs that are attached to inserted emails, if it makes sense to store these in Drive and just save the links to them in SQL this would be acceptable.  

Performance:

Please keep the performance in mind and the removal tool works well on a domain with ~50k users now.

The submission must meet following requirements, the develop domain provided to developers doesn't have so many users but we would consider the performance in review phase and the winner will get an account of another domain which have many users to make sure the final winning submission could meet the following requirements:

  • Newly created users that need messages to be deleted at one time may include as many as 5000-8000 users.  Currently in these challenges, users have been created or moved hundreds at a time.  This should be taken into consideration for timing when larger number of users are being moved.
  • Users moved from various OUs at one time may include as many as 5000-8000 users
  • Current use case is to delete the 3 welcome emails and inserting x number of new emails meaning 8000*3 = 24000 + (8000 * x) calls to the Gmail APIs.  This should be taken into account when configuring the task queues that will be used for this process.
  • This application should be built and configured to run as quickly as possible.  It is not expected that developers run this application against thousands of users, but detail what performance should be if and when it is.  
  • Ideally if 16000 users need emails to be deleted and inserted the tool would finish within a couple of hours.

AJAX:

This application makes extensive use of AJAX technique to avoid full-page refreshes.

The following is a general guideline for working with AJAX in this application:

$.ajax({
   url : "/search/auditRecords",
   type : "GET",
   success : function() {
       // Perform logic after success
       ...
   },

    error : function(request, status, error) {
       ...
   }
});

 

1.3     Technology overview



Final Submission Guidelines

  • Source code and configuration files.
  • Deployment guide to configure and verify the application.

ELIGIBLE EVENTS:

2015 topcoder Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30049588