Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure default subscriptions #159

Closed
kiskoza opened this issue Mar 17, 2021 · 2 comments
Closed

Configure default subscriptions #159

kiskoza opened this issue Mar 17, 2021 · 2 comments

Comments

@kiskoza
Copy link
Contributor

kiskoza commented Mar 17, 2021

Problem or use case

I'm trying to create a system where the notifications can't be turned off (you'll see them in the header), but you can add additional ways to get the notifications, for example email or push notification to a companion app. All I can do right now is turn on / off ActivityNotification.config.subscribe_as_default which will either turn on all or none of the notification strategies.

Expected solution

It would be nice if you could configure subscribe_to_email_as_default and subscribe_to_optional_targets_as_default. Leaving them out from the config file would fall back to the existing config.

ActivityNotification.configure do |config|
  ## Show in-app notifications by default
  config.subscribe_as_default = true
  
  ## Don't send out emails before the user allows it
  config.subscribe_to_email_as_default = false
  
  ## Subscribe to slack, amazon_sns, etc by default, but not to firebase_push
  config.subscribe_to_optional_targets_as_default = [:slack, :amazon_sns, :etc]
  ## or turn on all optional targets as default
  # config.subscribe_to_optional_targets_as_default = true
  ## or turn off all optional targets as default
  # config.subscribe_to_optional_targets_as_default = false
end

Alternatives

I was thinking about creating a default subscription entity for all users, but that would be the opposite of having defaults.

@simukappu
Copy link
Owner

Hi @kiskoza,
I agree with your feature request but I've added several comments for your PR. Thank you for your contribution!

@simukappu
Copy link
Owner

simukappu commented Apr 18, 2021

We've just merged your PR and released as new v2.2.2.
Thank you so much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants