Skip to content

SDK v4.3.3

Compare
Choose a tag to compare
@xr0master xr0master released this 07 Mar 11:55
· 11 commits to main since this release

Improvements

The EmailJSResponseStatus model is explicitly exported to detect the error instance.

import emailjs from '@emailjs/browser';

try {
  await emailjs.send('YOUR_SERVICE_ID', 'YOUR_TEMPLATE_ID');
  console.log('SUCCESS!');
} catch (error) {
  if (error instanceof emailjs.EmailJSResponseStatus) {
    console.log('EMAILJS FAILED...', error);
    return;
  }

  console.log('ANOTHER ERROR', error);
}

Essential Links