# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---
# This file configures "evergreen" messages that are displayed via
# the Nimbus Messaging system.
#
# They are "evergreen" in that they apply to all users, and shipped with the app.
#
# This file is intended to grow new messages once messages have been tested via
# experiment, rolled out to everyone in the release, and are ready to be rolled out
# without the remote prompting from Experimenter.
#
# When adding new messages to this file, please add the experiment (and/or rollout) URLs used to
# validate them.
#
# Triggers, actions and styles are configured in messaging-fenix.fml.yaml.
import:
  - path: ../../android-components/components/service/nimbus/messaging.fml.yaml
    channel: release
    features:
      messaging:
        # This message displays on the homescreen, asking the user to set Firefox as the default.
        # It is triggered after a minimum of 4 launches of the app.
        - value:
            messages:
              default-browser:
                title: default_browser_experiment_card_title
                text: default_browser_experiment_card_text
                surface: homescreen
                action: "MAKE_DEFAULT_BROWSER"
                trigger-if-all:
                  - USER_ESTABLISHED_INSTALL
                  - ANDROID_API_BELOW_29
                exclude-if-any:
                  - I_AM_DEFAULT_BROWSER
                style: PERSISTENT
                button-label: preferences_set_as_default_browser
            triggers:
              USER_ESTABLISHED_INSTALL: "number_of_app_launches >=4"
              ANDROID_API_BELOW_29: "android_version < 29"

        # This message displays as a 'push' notification, asking the user to set Firefox as the default.
        # It is triggered three days after install.
        - value:
            messages:
              default-browser-notification:
                title: nimbus_notification_default_browser_title
                text: nimbus_notification_default_browser_text
                surface: notification
                style: NOTIFICATION
                trigger-if-all:
                  - DAY_3_AFTER_INSTALL
                exclude-if-any:
                  - I_AM_DEFAULT_BROWSER
                action: MAKE_DEFAULT_BROWSER

        # This message displays as a microsurvey prompt after the user taps on the `Print` menu.
        - channel: developer
          value:
            messages:
              microsurvey-printing-example:
                title: microsurvey_prompt_printing_title
                text: microsurvey_survey_printing_title
                surface: microsurvey
                trigger-if-all:
                  - RECENTLY_PRINTED
                style: MICROSURVEY
                microsurvey-config:
                  utm-content: "homepage"
                  icon: ic_print
                  answers:
                    - text: likert_scale_option_1
                      ordering: 0
                    - text: likert_scale_option_2
                      ordering: 1
                    - text: likert_scale_option_3
                      ordering: 2
                    - text: likert_scale_option_4
                      ordering: 3
                    - text: likert_scale_option_5
                      ordering: 4
                    - text: likert_scale_option_6
                      ordering: 5

              # This message displays as a microsurvey prompt after the user taps on the Uninstall app shortcut.
              microsurvey-uninstall-survey:
                title: microsurvey_uninstall_survey_title
                text: microsurvey_uninstall_survey_title
                surface: microsurvey
                trigger-if-all:
                  - NEVER
                style: MICROSURVEY
                microsurvey-config:
                  utm-content: "uninstall_shortcut"
                  icon: ic_delete_black
                  answers:
                    - text: uninstall_survey_option_1_v2
                      ordering: 0
                    - text: uninstall_survey_option_2_v2
                      ordering: 1
                    - text: uninstall_survey_option_3_v2
                      ordering: 2
                    - text: uninstall_survey_option_4_v2
                      ordering: 3
                    - text: uninstall_survey_option_5_v2
                      ordering: 4
                    - text: uninstall_survey_option_6_v2
                      ordering: 5

        # This message displays as a microsurvey prompt after the user taps on the `Print` menu.
        - channel: nightly
          value:
            messages:
              microsurvey-printing-example-nightly:
                title: microsurvey_prompt_printing_title
                text: microsurvey_survey_printing_title
                surface: microsurvey
                trigger-if-all:
                  - RECENTLY_PRINTED
                style: MICROSURVEY
                microsurvey-config:
                  utm-content: "homepage"
                  icon: ic_print
                  answers:
                    - text: likert_scale_option_1
                      ordering: 0
                    - text: likert_scale_option_2
                      ordering: 1
                    - text: likert_scale_option_3
                      ordering: 2
                    - text: likert_scale_option_4
                      ordering: 3
                    - text: likert_scale_option_5
                      ordering: 4
                    - text: likert_scale_option_6
                      ordering: 5

              # This message displays as a microsurvey prompt after the user taps on the Uninstall app shortcut.
              microsurvey-uninstall-survey:
                title: microsurvey_uninstall_survey_title
                text: microsurvey_uninstall_survey_title
                surface: microsurvey
                trigger-if-all:
                  - NEVER
                style: MICROSURVEY
                microsurvey-config:
                  utm-content: "uninstall_shortcut"
                  icon: ic_delete_black
                  answers:
                    - text: uninstall_survey_option_1_v2
                      ordering: 0
                    - text: uninstall_survey_option_2_v2
                      ordering: 1
                    - text: uninstall_survey_option_3_v2
                      ordering: 2
                    - text: uninstall_survey_option_4_v2
                      ordering: 3
                    - text: uninstall_survey_option_5_v2
                      ordering: 4
                    - text: uninstall_survey_option_6_v2
                      ordering: 5
