FEATURE: send push notif if available on reminder
This commit is contained in:
		
							parent
							
								
									2f45fd7633
								
							
						
					
					
						commit
						c3cd29f2e5
					
				|  | @ -42,6 +42,10 @@ en: | |||
|     more_than_two_dates: "A post of a calendar topic can’t contain more than two dates." | ||||
|     event_expired: "Event expired" | ||||
|   discourse_post_event: | ||||
|     notifications: | ||||
|       before_event_reminder: "%{title} is about to start." | ||||
|       after_event_reminder: "%{title} has ended." | ||||
|       ongoing_event_reminder: "%{title} is ongoing." | ||||
|     errors: | ||||
|       bulk_invite: | ||||
|         max_invitees: "First %{max_invittes} invitees have been created. Try splitting the file in smaller parts." | ||||
|  |  | |||
|  | @ -51,6 +51,18 @@ module Jobs | |||
|             message: "discourse_post_event.notifications.#{prefix}_event_reminder" | ||||
|           }.to_json | ||||
|         ) | ||||
| 
 | ||||
|         PostAlerter.new(event.post).create_notification_alert( | ||||
|           user: invitee.user, | ||||
|           post: event.post, | ||||
|           username: invitee.user.username, | ||||
|           notification_type: Notification.types[:event_reminder] || Notification.types[:custom], | ||||
|           excerpt: I18n.t( | ||||
|             "discourse_post_event.notifications.#{prefix}_event_reminder", | ||||
|             title: event.name || event.post.topic.title, | ||||
|             locale: invitee.user.effective_locale | ||||
|           ) | ||||
|         ) | ||||
|       end | ||||
|     end | ||||
|   end | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue