1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-03-21 12:29:03 +01:00

notify after members sync on stripe

This commit is contained in:
Sylvain 2020-06-09 15:06:46 +02:00
parent a70668f52a
commit dbda82ac9b
8 changed files with 21 additions and 0 deletions

View File

@ -53,6 +53,7 @@ class NotificationType
notify_admin_refund_created
notify_admins_role_update
notify_user_role_update
notify_admin_members_stripe_sync
]
# deprecated:
# - notify_member_subscribed_plan_is_changed

View File

@ -0,0 +1,2 @@
json.title notification.notification_type
json.description t('.all_members_sync')

View File

@ -0,0 +1 @@
<p><%= t('.body.members_sync') %></p>

View File

@ -57,5 +57,10 @@ class StripeWorker
end
end
LOGGER&.debug ['StripeWorker', 'SyncMembers', 'Sync is done']
notify_user = Setting.find_by(name: 'stripe_secret_key')&.history_values&.last&.invoicing_profile&.user
return unless notify_user
NotificationCenter.call type: :notify_admin_members_stripe_sync,
receiver: notify_user
end
end

View File

@ -340,6 +340,8 @@ en:
your_role_is_ROLE: "Your role has been changed to %{ROLE}."
notify_admins_role_update:
user_NAME_changed_ROLE_html: "User <strong><em>%{NAME}</strong></em> is now %{ROLE}."
notify_admin_members_stripe_sync:
all_members_sync: "All members were successfully synchronized on Stripe."
#statistics tools for admins
statistics:
subscriptions: "Subscriptions"

View File

@ -340,6 +340,8 @@ fr:
your_role_is_ROLE: "Votre rôle a été changé en %{ROLE}."
notify_admins_role_update:
user_NAME_changed_ROLE_html: "L'utilisateur <strong><em>%{NAME}</strong></em> est maintenant %{ROLE}."
notify_admin_members_stripe_sync:
all_members_sync: "Tous les membres ont été synchronisés sur Stripe avec succès."
#statistics tools for admins
statistics:
subscriptions: "Abonnements"

View File

@ -283,5 +283,9 @@ en:
subject: "Your role has changed"
body:
role_changed_html: "Your role at {GENDER, select, male{the} female{the} neutral{} other{the}} {NAME} has changed. You are now <strong>{ROLE}</strong>.<br/>With great power comes great responsibility, use your new privileges fairly and respectfully."
notify_admin_members_stripe_sync:
subject: "Stripe synchronization"
body:
members_sync: "All members were successfully synchronized on Stripe."
shared:
hello: "Hello %{user_name}"

View File

@ -283,5 +283,9 @@ fr:
subject: "Vous avez changé de rôle"
body:
role_changed_html: "Votre rôle {GENDER, select, male{au} female{à la} neutral{} other{aux}} {NAME} a changé. Vous êtes maintenant <strong>{ROLE}</strong>.<br/>Avec un grand pouvoir vient une grande responsabilité, utilisez vos nouveaux privilèges de manière juste et respectueuse."
notify_admin_members_stripe_sync:
subject: "Synchronisation Stripe"
body:
members_sync: "Tous les members ont été synchronisés avec succès sur Stripe."
shared:
hello: "Bonjour %{user_name}"