Triggered email to contacts with code. Please Help!!

I am having a similar problem. My code shown below fails on the call to createContact(). The uninformative error message is also shown below. Any help is appreciated!
Thanks,
Daren

Error calling createContact(): internal_error, details: {} (500)

export function sendEmailButton_click(event, $w) {
	console.log('sendEmailButton clicked');
	const emailStr = $w("#email").value;
	console.log('email address entered = ' + emailStr);

	// Calling createContact() performs one of the following. 
	//	(The contact information specified in the contactInfo parameter matches 
	//	an existing contact if it contains an email address or phone number 
	//	from an existing contact.)
	// If there is a matching existing contact, it is updated with the information 
	// specified using the contactInfo parameter. Any existing contact information 
	// that is not explicity overriden in the contactInfo parameter retains its 
	// existing value.
	// http://www.wix.com/code/reference/wix-crm.html#createContact
	//
    wixCRM.createContact( {
      "emails": [$w("#email").value]
    } )
    .then ( (contactId) => {
		console.log('createContact() successful');
		console.log('contactID: '+contactId);

		wixCRM.emailContact("assesstrigger", contactId)  
			.then( () => {
				console.log("Triggered email sent");
			} )
			.catch( (err) => {
				console.log(err);
			} );
	} )
	.catch( (err) => {
		console.log('Error calling createContact(): ' + err);
	} );
}