@xenterprises/fastify-xemail 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/xEmail.js +1 -1
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ await fastify.register(xEmail, {
|
|
|
35
35
|
fastify.get('/send-welcome', async (request, reply) => {
|
|
36
36
|
const { email, name } = request.query;
|
|
37
37
|
|
|
38
|
-
await fastify.
|
|
38
|
+
await fastify.xEmail.send(
|
|
39
39
|
email,
|
|
40
40
|
'Welcome!',
|
|
41
41
|
`<h1>Welcome ${name}!</h1>`,
|
|
@@ -48,16 +48,16 @@ fastify.get('/send-welcome', async (request, reply) => {
|
|
|
48
48
|
|
|
49
49
|
## API
|
|
50
50
|
|
|
51
|
-
### `fastify.
|
|
51
|
+
### `fastify.xEmail.send(to, subject, html, text, extraOptions)`
|
|
52
52
|
Send a single email.
|
|
53
53
|
|
|
54
|
-
### `fastify.
|
|
54
|
+
### `fastify.xEmail.sendTemplate(to, subject, templateId, dynamicData, extraOptions)`
|
|
55
55
|
Send an email using a SendGrid dynamic template.
|
|
56
56
|
|
|
57
|
-
### `fastify.
|
|
57
|
+
### `fastify.xEmail.sendWithAttachments(to, subject, html, attachments)`
|
|
58
58
|
Send an email with attachments.
|
|
59
59
|
|
|
60
|
-
### `fastify.
|
|
60
|
+
### `fastify.xEmail.validate(email)`
|
|
61
61
|
Validate an email address using SendGrid's Validation API.
|
|
62
62
|
|
|
63
63
|
## License
|
package/index.d.ts
CHANGED
|
@@ -296,7 +296,7 @@ export interface XEmailPluginOptions {
|
|
|
296
296
|
declare module 'fastify' {
|
|
297
297
|
interface FastifyInstance {
|
|
298
298
|
/** Email service methods */
|
|
299
|
-
|
|
299
|
+
xEmail: EmailService;
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
|
|
@@ -317,7 +317,7 @@ declare module 'fastify' {
|
|
|
317
317
|
* });
|
|
318
318
|
*
|
|
319
319
|
* // Send email
|
|
320
|
-
* await fastify.
|
|
320
|
+
* await fastify.xEmail.send('user@example.com', 'Welcome', '<h1>Hello</h1>');
|
|
321
321
|
* ```
|
|
322
322
|
*/
|
|
323
323
|
declare const xEmail: FastifyPluginAsync<XEmailPluginOptions>;
|
package/package.json
CHANGED
package/src/xEmail.js
CHANGED