private void Send(string userId, Notification n, GroupOutletData o) { if (!_channels.ContainsKey(o.OutletType)) { throw new KeyNotFoundException($"Unsupported Outlet Type: {o.OutletType}"); } _channels[o.OutletType].Send(new RoutedNotification { Title = n.Title, Text = n.Text + GetUnsubscribeText(userId, n, o), Target = o.Target, }); }
private string GetUnsubscribeText(string userId, Notification n, GroupOutletData o) { return ($"\r\n\r\n---------------------------\r\nTo Unsubscribe Click - {_publicUrl}/api/notifications/unsubscribeMe?userId={userId}&topic={n.Topic}&outletGroup={o.OutletGroup}"); }