public static void createMessageCenterAutoMessage(Context context) {
    SharedPreferences prefs =
        context.getSharedPreferences(Constants.PREF_NAME, Context.MODE_PRIVATE);
    boolean shownAutoMessage =
        prefs.getBoolean(Constants.PREF_KEY_AUTO_MESSAGE_SHOWN_AUTO_MESSAGE, false);

    // Migrate old values if needed.
    boolean shownManual = prefs.getBoolean(Constants.PREF_KEY_AUTO_MESSAGE_SHOWN_MANUAL, false);
    boolean shownNoLove = prefs.getBoolean(Constants.PREF_KEY_AUTO_MESSAGE_SHOWN_NO_LOVE, false);
    if (!shownAutoMessage) {
      if (shownManual || shownNoLove) {
        shownAutoMessage = true;
        prefs.edit().putBoolean(Constants.PREF_KEY_AUTO_MESSAGE_SHOWN_AUTO_MESSAGE, true).commit();
      }
    }

    AutomatedMessage message = null;

    if (!shownAutoMessage) {
      prefs.edit().putBoolean(Constants.PREF_KEY_AUTO_MESSAGE_SHOWN_AUTO_MESSAGE, true).commit();
      message = AutomatedMessage.createWelcomeMessage(context);
    }
    if (message != null) {
      ApptentiveDatabase db = ApptentiveDatabase.getInstance(context);
      db.addOrUpdateMessages(message);
      db.addPayload(message);
    }
  }
 private void sendMessage(final Activity activity) {
   SharedPreferences prefs =
       activity.getSharedPreferences(Constants.PREF_NAME, Context.MODE_PRIVATE);
   prefs
       .edit()
       .putBoolean(Constants.PREF_KEY_MESSAGE_CENTER_SHOULD_SHOW_INTRO_DIALOG, false)
       .commit();
   // Save the email.
   if (interaction.isAskForEmail()) {
     if (email != null && email.length() != 0) {
       PersonManager.storePersonEmail(activity, email.toString());
       Person person = PersonManager.storePersonAndReturnDiff(activity);
       if (person != null) {
         Log.d("Person was updated.");
         Log.v(person.toString());
         ApptentiveDatabase.getInstance(activity).addPayload(person);
       } else {
         Log.d("Person was not updated.");
       }
     }
   }
   // Send the message.
   final TextMessage textMessage = new TextMessage();
   textMessage.setBody(message.toString());
   textMessage.setRead(true);
   /*
   		// TODO: Figure out how to add custom data here.
   		textMessage.setCustomData(customData);
   		customData = null;
   */
   MessageManager.sendMessage(activity, textMessage);
 }