Class NewsletterUserPreferencesManager
java.lang.Object
com.atlassian.jira.plugin.headernav.newsletter.NewsletterUserPreferencesManager
Manager to consult user preferences to determine if a newsletter signup tip should be shown.
-
Constructor Summary
ConstructorsConstructorDescriptionNewsletterUserPreferencesManager
(com.atlassian.core.util.Clock clock, ApplicationProperties applicationProperties, UserPreferencesManager userPreferencesManager, FeatureManager featureManager) -
Method Summary
Modifier and TypeMethodDescriptionboolean
shouldShowSignupTip
(io.atlassian.fugue.Option<ApplicationUser> user) Returns true if it's been more than 7 days after the first time they logged in.
-
Constructor Details
-
NewsletterUserPreferencesManager
public NewsletterUserPreferencesManager(com.atlassian.core.util.Clock clock, ApplicationProperties applicationProperties, UserPreferencesManager userPreferencesManager, FeatureManager featureManager)
-
-
Method Details
-
shouldShowSignupTip
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.
-