Class NewsletterUserPreferencesManager

java.lang.Object
com.atlassian.jira.plugin.headernav.newsletter.NewsletterUserPreferencesManager

public class NewsletterUserPreferencesManager extends Object
Manager to consult user preferences to determine if a newsletter signup tip should be shown.
  • Constructor Details

  • Method Details

    • shouldShowSignupTip

      public boolean shouldShowSignupTip(io.atlassian.fugue.Option<ApplicationUser> user)
      Returns true if it's been more than 7 days after the first time they logged in. The Newsletter signup tip should only show after this duration.

      For anonymous users this method will always return false.

      One side effect of calling this method is that the current time will be stored against a 'newsletter.signup.first.view' user preference for the provided user that will be used in subsequent calls to determine if enough time has elapsed before the newsletter signup tip can be shown.

      Parameters:
      user - Current user. May be empty for anonymous users.
      Returns:
      true if a user if it's been 7 days since the first time a user has accessed JIRA.