Update the customer’s date of birth. Returns true on success, false on failure.
Usage
MageSDK.updateCustomerDob('1990-05-15').then(function(success) {
if (success) {
alert('Birthday updated!');
}
});
Parameters
The date of birth in YYYY-MM-DD format.
Response
Returns a boolean — true if the update was successful, false otherwise.
<form id="update-dob-form">
<div>
<label>Date of Birth</label>
<input type="date" name="dob" id="dob">
</div>
<input type="submit" value="Update Date of Birth" />
</form>
<script>
document.addEventListener('DOMContentLoaded', function() {
var form = document.getElementById('update-dob-form');
form.addEventListener('submit', function(event) {
event.preventDefault();
var dob = document.getElementById('dob').value;
if (dob) {
MageSDK.updateCustomerDob(dob).then(function(success) {
if (success) {
alert("Updated the customer's birthday");
}
});
}
});
});
</script>