mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
19 lines
No EOL
686 B
JavaScript
19 lines
No EOL
686 B
JavaScript
Template.unsubscribe.created = function(){
|
|
var hash = FlowRouter.getParam("hash");
|
|
Meteor.call('unsubscribeUser', hash, function(error, result){
|
|
if(result){
|
|
Session.set('unsubscribedMessage', __('you_have_been_unsubscribed_from_all_notifications'));
|
|
}else{
|
|
Session.set('unsubscribedMessage', __('user_not_found'));
|
|
}
|
|
});
|
|
Events.track('notificationsUnsubcribe', {hash: hash});
|
|
};
|
|
|
|
Template.unsubscribe.helpers({
|
|
unsubscribed : function(){
|
|
// we have to use a session variable because the string we want to display
|
|
// depends on the return value of an asynchronous callback (unsubscribeUser)
|
|
return Session.get('unsubscribedMessage');
|
|
}
|
|
}); |