mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
19 lines
No EOL
711 B
JavaScript
19 lines
No EOL
711 B
JavaScript
Template[getTemplate('unsubscribe')].created = function(){
|
|
var hash = this.data.hash;
|
|
Meteor.call('unsubscribeUser', hash, function(error, result){
|
|
if(result){
|
|
Session.set('unsubscribedMessage', i18n.t('you_have_been_unsubscribed_from_all_notifications'));
|
|
}else{
|
|
Session.set('unsubscribedMessage', i18n.t('user_not_found'));
|
|
}
|
|
});
|
|
trackEvent('notificationsUnsubcribe', {hash: hash});
|
|
};
|
|
|
|
Template[getTemplate('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');
|
|
}
|
|
}); |