I implemented what was above (mostly without exception....) but
- nothing sends and I'm not sure how to trap the error from the service (if there is one ...) Here's my code
function fsharebyemail(){
// share opportunities by email... the new routine
var formData = new FormData();
var api_user = 'mapiusercodeishere';
var api_key = 'mypasswordishere';
var ssubject = '';
var shtml = fscrubhtml(Appery('html_tosend').text());
console.log('raw html is:' + shtml ); // this results in the formatted html - and looks mostly correct - good enough for debugging and testing
ssubject = localStorage.getItem('susername') + ' has shared a Sales Opportunity for: ' + Appery('label_opptyname').text() + ' with you' ;
console.log( 'subject is: ' + ssubject ); // this also looks good in the log
var body = {
"subject": ssubject ,
"html": shtml,
"from": "a href="mailto:bruce.stuart@the-software-studio.com" rel="nofollow"bruce.stuart@the-software-studio.com/a",
"api_user": api_user,
"api_key": api_key,
'fromname': 'TrueBlue COA Adminstrator',
"to": localStorage.getItem('s_emailtoshare')
};
for(var i in body)
formData.append(i, body);
service_send_email_byproxy.execute({
'body': {data: formData},
});
}
// what comes back from the execution - is a 404 not found.... with this result:
(console log:)
and this as the 'more information' on the 404 error:
What might I need to tweak to get this to work like it did for you ?
Best,
Bruce