Posted on by
Hi Guys,
I have a Button in my Email Template body, after click the button new window gets open then other time i press the button means the link want to expire how to achieve this..Help me
Thanks in Advance,
Dinesh Raja
Categories:
-
Suggested answer
Like'; var react_Snippet = ' Like'; function HandleReactionRecord(e, targetRecordId) { var reaction_ControlId = "#"+e.id; try{ if(false == false){ window.location.href = "/signin?returnUrl="+window.location.pathname+window.location.search; }else{ $(reaction_ControlId).parent().block({ message: '', overlayCSS: { backgroundColor: '#e0dede', opacity:0.6} }); var entityParams = { isReactedByUser: $(reaction_ControlId).attr("user-reaction") == "true" ? true : false, reactionEntityName: $(reaction_ControlId).attr("reactionEntityName"), contactId: userId, recordId: targetRecordId, reactionType: "Like", reactionId: $(reaction_ControlId).attr("reaction-id"), siteId: "44c1922b-d231-4183-bae6-be148059122f", comment:$(reaction_ControlId).attr("commentflag") == 'true'?true:false }; LoadReactionControl(entityParams, successCallback, errorCallback); function successCallback(createdRecordId, res, status, xhr){ $(reaction_ControlId).attr("reaction-id", createdRecordId); if(createdRecordId != "" && createdRecordId != undefined){ $(reaction_ControlId).attr("user-reaction", true); $(reaction_ControlId).empty(); $(reaction_ControlId).html(reacted_Snippet); }else{ $(reaction_ControlId).attr("user-reaction", false); $(reaction_ControlId).empty(); $(reaction_ControlId).html(react_Snippet); } $(reaction_ControlId).parent().unblock(); } function errorCallback(res){ if(res.status == 500 && $(reaction_ControlId).attr("user-reaction") == "true"){ getRecord("mspwrplt_cmty_discussionreaction", '', targetRecordId, function(){}, errRetrieve); } $(reaction_ControlId).parent().unblock(); } function errRetrieve(res){ if(res.status == 404){ $(reaction_ControlId).attr("user-reaction", false); $(reaction_ControlId).attr("reaction-id", ''); $(reaction_ControlId).empty(); $(reaction_ControlId).html(react_Snippet); } $(reaction_ControlId).parent().unblock(); } } }catch(err) { console.error(err.message); $(reaction_ControlId).parent().unblock(); } }(0)
RE: How to set expire a link after one time click
You may have to generate some unique random key, store in your database table & send with the url querystring, then on click of link - capture the key in window form load as already visited in the same database table entry.
Next time when the same link is clicked - verify in the already visited table, say users its already expired.