Our business is trying to implement a solution tha...
# suitescript
a
Our business is trying to implement a solution that would confirm or modify shipping address when the order is about to dispatch through an email. We are thinking of adding a link within the email where the client can confirm or modify their address. What would be the best way to get that response back into Netsuite with the confirmation or address update automatically saved?
a
I'm assuming your customers don't have NS access. So you'd need the link to point to an available without login suitelet. There's security concerns with this though that you'd probably want to mitigate. the best approach would likely be to create a custom record when you send the email to store the various pieces of data you will need. record type, record id, customer email, customer id etc. etc. you then generate the link in the email to just have a reference to the custom record as a url paramater rather than a bunch of human-readable and easily edited url parameters I'd also encode that paramter so instead of it being
<https://accountnum.netsute.com/etc/etc/etc?customrecordid=1>
you'd encode the value using some kinda of crypto to generate a hash so you link looks like
<https://accountnum.netsute.com/etc/etc/etc?hash=s234SDFjc12348SDFjl84jf09FSDFliu34jfs>
that way no one can easily spoof a good link in the suitelet you decode the hash, check for a corresponding custom record, if there is one you load that custom record with all the transaction specific data you need to update the address you might also want to compare datecreated on the custom record with new Date() and then see how old the link is and reject them if its greater than some window you determine is reasonable... 24hrs? 48hrs? on time out rejection provide a button to send another email to the email on file for that custom record, which would generated a new custom record and new link with new hash to that new custom record. that way if they're not trying to hack you and are just slow to click the link they can still make the address update but you don't have all your links that you ever created potentially available for abuse. this is somewhat similar to a standard forgot password workflow once you've confirmed that the custom record is good, and that the it is within your timeframe, have the suitelet generate a form for them to input the shipaddress on submit update the shipaddress on the transaction and presumably release the shipment with a status update. you can either put 2 links in the email one to confirm address as is, the other for them to update. or you can do it with a single link and have the form have a way to either confirm or update the current shipadadress. btw.. what happens if they don't click the link? you just won't ship the order? for ever?
I used to ask a question like this in interviews for senior/architect level positions... not that I'd expect an answer like the above but it was good way to have a conversation about a difficult technical problem and talk about tradeoffs
s
better to manage this through an authenticated customer center portal of some sort rather than roll-your-own security.
💯 1
a
true that has an associated cost though, and people aren't always willing/able to spend
a
Thank you for taking the time to write this. It makes sense! Regarding if the customer don't click the link, I'm thinking of setting up a checkbox for address confirmed when the information is returned @Anthony OConnor