mirror of
https://github.com/vale981/Vulcan
synced 2025-03-08 19:11:38 -05:00
19 lines
No EOL
678 B
JavaScript
19 lines
No EOL
678 B
JavaScript
Template.unsubscribe.created = function(){
|
|
var hash = Session.get('userEmailHash');
|
|
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.');
|
|
}
|
|
});
|
|
trackEvent('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');
|
|
}
|
|
}); |