Skip to content

Commit

Permalink
Automatically sync juntadirectiva@ G Suite group.
Browse files Browse the repository at this point in the history
We have also changed `notificaciones@` to `notificaciones-socios@` to 
avoid having the group named the same as the application default from 
address.

This is a part of #21.
  • Loading branch information
AlbertoPdRF committed Aug 17, 2019
1 parent a8018bf commit 3b367b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/tasks/scheduler.rake
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ namespace :scheduler do
desc "Daily task to sync mailing lists"
task :sync_groups => :environment do
sync_job_messages = []
# Mailing list for the Board
board = User.select(&:board).map(&:ams_email)
sync_job_messages << GsuiteMailingLists.sync_group("[email protected]", subscribers_with_notifications)

# Mailing list for automatic notifications to subscribers
subscribers_with_notifications = User.subscription_notification_enabled.with_active_subscription.map(&:ams_email)
subscribers_with_notifications << "[email protected]"
sync_job_messages << GsuiteMailingLists.sync_group("[email protected]", subscribers_with_notifications)
sync_job_messages << GsuiteMailingLists.sync_group("[email protected]", subscribers_with_notifications)

message = "Se ha realizado la sincronización de los grupos.\n"
if sync_job_messages.empty?
Expand Down

0 comments on commit 3b367b8

Please sign in to comment.