We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef3240a commit d9cccc0Copy full SHA for d9cccc0
README.md
@@ -107,6 +107,31 @@ emailjs
107
);
108
```
109
110
+**await/async with EmailJS error handler**
111
+
112
+```js
113
+import emailjs, { EmailJSResponseStatus } from '@emailjs/browser';
114
115
+try {
116
+ await emailjs.send(
117
+ 'YOUR_SERVICE_ID',
118
+ 'YOUR_TEMPLATE_ID',
119
+ {},
120
+ {
121
+ publicKey: 'YOUR_PUBLIC_KEY',
122
+ },
123
+ );
124
+ console.log('SUCCESS!');
125
+} catch (err) {
126
+ if (err instanceof EmailJSResponseStatus) {
127
+ console.log('EMAILJS FAILED...', err);
128
+ return;
129
+ }
130
131
+ console.log('ERROR', err);
132
+}
133
+```
134
135
## Configuration
136
137
**Options**
0 commit comments